!142 开源之夏2024 - 247180565 - 结项

Merge pull request !142 from 杨胜毅/ai-module
This commit is contained in:
KevinDuan 2024-10-08 06:05:31 +00:00 committed by Gitee
commit 999ae567c7
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
49 changed files with 2106 additions and 302 deletions

View File

@ -1,10 +1,15 @@
QT += core gui svg KWindowSystem multimedia multimediawidgets concurrent
QT += core gui svg KWindowSystem multimedia multimediawidgets concurrent dbus printsupport
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
CONFIG += c++11 link_pkgconfig
PKGCONFIG += kysdk-qtwidgets kysdk-waylandhelper kysdk-sysinfo kysdk-datacollect gsettings-qt
KF5 += i18n doctools guiaddons widgetsaddons kio xmlgui textwidgets jobwidgets
PKGCONFIG += kysdk-qtwidgets kysdk-waylandhelper kysdk-sysinfo kysdk-datacollect gsettings-qt kylin-ai-base jsoncpp json-glib-1.0
INCLUDEPATH += /usr/include/KF5
INCLUDEPATH += /usr/include/KF5/KI18n
# The following define makes your compiler emit warnings if you use
# any Qt feature that has been marked deprecated (the exact warnings
@ -50,7 +55,8 @@ SOURCES += \
src/module/plymouththemefeature.cpp \
src/module/plymouththemewidget.cpp \
src/module/savepathdialog.cpp \
src/titlebar.cpp
src/titlebar.cpp \
src/aithemebar.cpp
HEADERS += \
src/build/build.h \
@ -84,7 +90,8 @@ HEADERS += \
src/module/plymouththemefeature.h \
src/module/plymouththemewidget.h \
src/module/savepathdialog.h \
src/titlebar.h
src/titlebar.h \
src/aithemebar.h
RESOURCES += \
resource.qrc
@ -103,4 +110,5 @@ appdesktop.files += kylin-theme-builder.desktop
appdesktop.path = /usr/share/applications/
INSTALLS +=target qm_files appdesktop
LIBS += -lukui-log4qt
LIBS += -lukui-log4qt -L/usr/lib/x86_64-linux-gnu -lKF5I18n

BIN
pics/AI-Drawing@2x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
pics/bg@2x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

BIN
pics/loading.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

11
pics/slogo-Drawing.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 28 KiB

BIN
pics/style/style-all.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
pics/style/style-all@2x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
pics/style/style-anime.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
pics/style/style-lolita.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

BIN
pics/style/style-pixel.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
pics/style/style-ukiyoe.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -1,261 +1,299 @@
<RCC>
<qresource prefix="/">
<file>resource/appicons/biometric-manager.png</file>
<file>resource/appicons/box-manager.png</file>
<file>resource/appicons/burner.png</file>
<file>resource/appicons/indicator-china-weather.png</file>
<file>resource/appicons/ksc-defender.png</file>
<file>resource/appicons/kylin-alarm-clock.png</file>
<file>resource/appicons/kylin-assistant.png</file>
<file>resource/appicons/kylin-calculator.png</file>
<file>resource/appicons/kylin-camera.png</file>
<file>resource/appicons/kylin-connectivity.png</file>
<file>resource/appicons/kylin-font-viewer.png</file>
<file>resource/appicons/kylin-installer.png</file>
<file>resource/appicons/kylin-ipmsg.png</file>
<file>resource/appicons/kylin-log-viewer.png</file>
<file>resource/appicons/kylin-music.png</file>
<file>resource/appicons/kylin-new-function-introduction.png</file>
<file>resource/appicons/kylin-notebook.png</file>
<file>resource/appicons/kylin-os-manager.png</file>
<file>resource/appicons/kylin-photo-viewer.png</file>
<file>resource/appicons/kylin-printer.png</file>
<file>resource/appicons/kylin-recorder.png</file>
<file>resource/appicons/kylin-screenshot.png</file>
<file>resource/appicons/kylin-service-support.png</file>
<file>resource/appicons/kylin-software-center.png</file>
<file>resource/appicons/kylin-usb-creator.png</file>
<file>resource/appicons/kylin-user-guide.png</file>
<file>resource/appicons/kylin-video.png</file>
<file>resource/appicons/system-file-manager.png</file>
<file>resource/appicons/ukui-control-center.png</file>
<file>resource/appicons/ukui-system-monitor.png</file>
<file>resource/appicons/utilities-terminal.png</file>
<file>resource/appicons/yhkylin-backup-tools.png</file>
<file>resource/systemicons/kylin-settings-account.png</file>
<file>resource/systemicons/kylin-settings-application.png</file>
<file>resource/systemicons/kylin-settings-datetime.png</file>
<file>resource/systemicons/kylin-settings-devices.png</file>
<file>resource/systemicons/kylin-settings-network.png</file>
<file>resource/systemicons/kylin-settings-personalized.png</file>
<file>resource/systemicons/kylin-settings-search.png</file>
<file>resource/systemicons/kylin-settings-security.png</file>
<file>resource/systemicons/kylin-settings-system.png</file>
<file>resource/systemicons/kylin-settings-update.png</file>
<file>resource/time-cursor/left_ptr_watch_1.png</file>
<file>resource/background/controlcenter-light.png</file>
<file>resource/background/controlcenter-dark.png</file>
<file>resource/background/background-glazing.png</file>
<file>resource/background/background-dark.png</file>
<file>resource/background/background-light.png</file>
<file>resource/background/panel-dark.png</file>
<file>resource/background/panel-light.png</file>
<file>resource/background/homepage-cursor.png</file>
<file>resource/background/homepage-global.png</file>
<file>resource/background/homepage-icons.png</file>
<file>resource/systemicons/kylin-settings-commoninfo.png</file>
<file>resource/config/theme.conf</file>
<file>resource/debian/rules</file>
<file>resource/debian/copyright</file>
<file>resource/debian/source/format</file>
<file>resource/debian/postinst</file>
<file>resource/debian/postrm</file>
<file>resource/background/homepage-boot.png</file>
<file>resource/background/openKylin.svg</file>
<file>resource/background/grub-listview.png</file>
<file>resource/background/homepage-plymouth.png</file>
<file>resource/background/homepage-grub.png</file>
<file>resource/cursor/all-scroll.png</file>
<file>resource/cursor/bottom_tee.png</file>
<file>resource/cursor/circle.png</file>
<file>resource/cursor/left_ptr.png</file>
<file>resource/cursor/right_ptr.png</file>
<file>resource/cursor/color-picker.png</file>
<file>resource/cursor/cross.png</file>
<file>resource/cursor/dnd-ask.png</file>
<file>resource/cursor/dnd-copy.png</file>
<file>resource/cursor/dnd-link.png</file>
<file>resource/cursor/dnd-none.png</file>
<file>resource/cursor/dotbox.png</file>
<file>resource/cursor/h_double_arrow.png</file>
<file>resource/cursor/hand1.png</file>
<file>resource/cursor/hand2.png</file>
<file>resource/cursor/left_tee.png</file>
<file>resource/cursor/pencil.png</file>
<file>resource/cursor/plus.png</file>
<file>resource/cursor/right_tee.png</file>
<file>resource/cursor/sb_down_arrow.png</file>
<file>resource/cursor/sb_h_double_arrow.png</file>
<file>resource/cursor/sb_left_arrow.png</file>
<file>resource/cursor/sb_right_arrow.png</file>
<file>resource/cursor/sb_up_arrow.png</file>
<file>resource/cursor/sb_v_double_arrow.png</file>
<file>resource/cursor/tcross.png</file>
<file>resource/cursor/top_tee.png</file>
<file>resource/cursor/ul_angle.png</file>
<file>resource/cursor/ur_angle.png</file>
<file>resource/cursor/v_double_arrow.png</file>
<file>resource/cursor/vertical_text.png</file>
<file>resource/cursor/X_cursor.png</file>
<file>resource/cursor/xterm.png</file>
<file>resource/cursor/zoom-in.png</file>
<file>resource/cursor/zoom-out.png</file>
<file>resource/time-cursor/left_ptr_watch_2.png</file>
<file>resource/time-cursor/left_ptr_watch_3.png</file>
<file>resource/time-cursor/left_ptr_watch_4.png</file>
<file>resource/time-cursor/left_ptr_watch_5.png</file>
<file>resource/time-cursor/watch_1.png</file>
<file>resource/time-cursor/watch_2.png</file>
<file>resource/time-cursor/watch_3.png</file>
<file>resource/time-cursor/watch_4.png</file>
<file>resource/time-cursor/watch_5.png</file>
<file>resource/time-cursor/watch_6.png</file>
<file>resource/time-cursor/watch_7.png</file>
<file>resource/time-cursor/watch_8.png</file>
<file>resource/time-cursor/watch_9.png</file>
<file>resource/time-cursor/watch_10.png</file>
<file>resource/background/kylin.gif</file>
<file>resource/plymouth-other/logo.script</file>
<file>resource/plymouth-other/uk.png</file>
<file>resource/plymouth-other/password_field.png</file>
<file>resource/plymouth-other/progress_dot_off.png</file>
<file>resource/plymouth/104.png</file>
<file>resource/plymouth/103.png</file>
<file>resource/plymouth/102.png</file>
<file>resource/plymouth/101.png</file>
<file>resource/plymouth/100.png</file>
<file>resource/plymouth/99.png</file>
<file>resource/plymouth/98.png</file>
<file>resource/plymouth/97.png</file>
<file>resource/plymouth/96.png</file>
<file>resource/plymouth/95.png</file>
<file>resource/plymouth/94.png</file>
<file>resource/plymouth/93.png</file>
<file>resource/plymouth/92.png</file>
<file>resource/plymouth/91.png</file>
<file>resource/plymouth/90.png</file>
<file>resource/plymouth/89.png</file>
<file>resource/plymouth/88.png</file>
<file>resource/plymouth/87.png</file>
<file>resource/plymouth/86.png</file>
<file>resource/plymouth/85.png</file>
<file>resource/plymouth/84.png</file>
<file>resource/plymouth/83.png</file>
<file>resource/plymouth/82.png</file>
<file>resource/plymouth/81.png</file>
<file>resource/plymouth/80.png</file>
<file>resource/plymouth/79.png</file>
<file>resource/plymouth/78.png</file>
<file>resource/plymouth/77.png</file>
<file>resource/plymouth/76.png</file>
<file>resource/plymouth/75.png</file>
<file>resource/plymouth/74.png</file>
<file>resource/plymouth/73.png</file>
<file>resource/plymouth/72.png</file>
<file>resource/plymouth/71.png</file>
<file>resource/plymouth/70.png</file>
<file>resource/plymouth/69.png</file>
<file>resource/plymouth/68.png</file>
<file>resource/plymouth/67.png</file>
<file>resource/plymouth/66.png</file>
<file>resource/plymouth/65.png</file>
<file>resource/plymouth/64.png</file>
<file>resource/plymouth/63.png</file>
<file>resource/plymouth/62.png</file>
<file>resource/plymouth/61.png</file>
<file>resource/plymouth/60.png</file>
<file>resource/plymouth/59.png</file>
<file>resource/plymouth/58.png</file>
<file>resource/plymouth/57.png</file>
<file>resource/plymouth/56.png</file>
<file>resource/plymouth/55.png</file>
<file>resource/plymouth/54.png</file>
<file>resource/plymouth/53.png</file>
<file>resource/plymouth/52.png</file>
<file>resource/plymouth/51.png</file>
<file>resource/plymouth/50.png</file>
<file>resource/plymouth/49.png</file>
<file>resource/plymouth/48.png</file>
<file>resource/plymouth/47.png</file>
<file>resource/plymouth/46.png</file>
<file>resource/plymouth/45.png</file>
<file>resource/plymouth/44.png</file>
<file>resource/plymouth/43.png</file>
<file>resource/plymouth/42.png</file>
<file>resource/plymouth/41.png</file>
<file>resource/plymouth/40.png</file>
<file>resource/plymouth/39.png</file>
<file>resource/plymouth/38.png</file>
<file>resource/plymouth/37.png</file>
<file>resource/plymouth/36.png</file>
<file>resource/plymouth/35.png</file>
<file>resource/plymouth/34.png</file>
<file>resource/plymouth/33.png</file>
<file>resource/plymouth/32.png</file>
<file>resource/plymouth/31.png</file>
<file>resource/plymouth/30.png</file>
<file>resource/plymouth/29.png</file>
<file>resource/plymouth/28.png</file>
<file>resource/plymouth/27.png</file>
<file>resource/plymouth/26.png</file>
<file>resource/plymouth/25.png</file>
<file>resource/plymouth/24.png</file>
<file>resource/plymouth/23.png</file>
<file>resource/plymouth/22.png</file>
<file>resource/plymouth/21.png</file>
<file>resource/plymouth/20.png</file>
<file>resource/plymouth/19.png</file>
<file>resource/plymouth/18.png</file>
<file>resource/plymouth/17.png</file>
<file>resource/plymouth/16.png</file>
<file>resource/plymouth/15.png</file>
<file>resource/plymouth/14.png</file>
<file>resource/plymouth/13.png</file>
<file>resource/plymouth/12.png</file>
<file>resource/plymouth/11.png</file>
<file>resource/plymouth/10.png</file>
<file>resource/plymouth/9.png</file>
<file>resource/plymouth/8.png</file>
<file>resource/plymouth/7.png</file>
<file>resource/plymouth/6.png</file>
<file>resource/plymouth/5.png</file>
<file>resource/plymouth/4.png</file>
<file>resource/plymouth/3.png</file>
<file>resource/plymouth/2.png</file>
<file>resource/plymouth/1.png</file>
<file>resource/background/custom-preview.png</file>
<file>resource/background/1-openkylin.jpg</file>
<file>resource/background/grub-background.png</file>
<file>resource/config/json.txt</file>
<file>resource/blacklist.txt</file>
<file>resource/mimetypes/application-x-desktop.svg</file>
<file>resource/config/40_kylin-theme-builder.gschema.override</file>
<file>resource/config/kylin-theme-builder-change</file>
<file>resource/config/kylin-theme-builder-change.desktop</file>
<file>resource/config/kylin-theme-builder.txt</file>
<file>resource/config/theme-builder-change.conf</file>
<file>resource/devices/computer.png</file>
<file>resource/devices/cupsprinter.png</file>
<file>resource/devices/drive-harddisk.png</file>
<file>resource/devices/drive-removable-media-usb.png</file>
<file>resource/devices/input-keyboard.png</file>
<file>resource/devices/input-mouse.png</file>
<file>resource/devices/scanner.png</file>
<file>resource/places/document-open-recent.png</file>
<file>resource/places/folder-documents.png</file>
<file>resource/places/folder-download.png</file>
<file>resource/places/folder-dropbox.png</file>
<file>resource/places/folder-music.png</file>
<file>resource/places/folder-open.png</file>
<file>resource/places/folder-pictures.png</file>
<file>resource/places/folder-publicshare.png</file>
<file>resource/places/folder-templates.png</file>
<file>resource/places/folder-videos.png</file>
<file>resource/places/inode-directory.png</file>
<file>resource/places/user-desktop.png</file>
<file>resource/places/user-home.png</file>
<file>resource/places/user-trash-full.png</file>
<file>resource/places/user-trash.png</file>
<file>resource/theme.desktop</file>
</qresource>
</RCC>
<RCC>
<qresource prefix="/">
<file>resource/appicons/biometric-manager.png</file>
<file>resource/appicons/box-manager.png</file>
<file>resource/appicons/burner.png</file>
<file>resource/appicons/indicator-china-weather.png</file>
<file>resource/appicons/ksc-defender.png</file>
<file>resource/appicons/kylin-alarm-clock.png</file>
<file>resource/appicons/kylin-assistant.png</file>
<file>resource/appicons/kylin-calculator.png</file>
<file>resource/appicons/kylin-camera.png</file>
<file>resource/appicons/kylin-connectivity.png</file>
<file>resource/appicons/kylin-font-viewer.png</file>
<file>resource/appicons/kylin-installer.png</file>
<file>resource/appicons/kylin-ipmsg.png</file>
<file>resource/appicons/kylin-log-viewer.png</file>
<file>resource/appicons/kylin-music.png</file>
<file>resource/appicons/kylin-new-function-introduction.png</file>
<file>resource/appicons/kylin-notebook.png</file>
<file>resource/appicons/kylin-os-manager.png</file>
<file>resource/appicons/kylin-photo-viewer.png</file>
<file>resource/appicons/kylin-printer.png</file>
<file>resource/appicons/kylin-recorder.png</file>
<file>resource/appicons/kylin-screenshot.png</file>
<file>resource/appicons/kylin-service-support.png</file>
<file>resource/appicons/kylin-software-center.png</file>
<file>resource/appicons/kylin-usb-creator.png</file>
<file>resource/appicons/kylin-user-guide.png</file>
<file>resource/appicons/kylin-video.png</file>
<file>resource/appicons/system-file-manager.png</file>
<file>resource/appicons/ukui-control-center.png</file>
<file>resource/appicons/ukui-system-monitor.png</file>
<file>resource/appicons/utilities-terminal.png</file>
<file>resource/appicons/yhkylin-backup-tools.png</file>
<file>resource/systemicons/kylin-settings-account.png</file>
<file>resource/systemicons/kylin-settings-application.png</file>
<file>resource/systemicons/kylin-settings-datetime.png</file>
<file>resource/systemicons/kylin-settings-devices.png</file>
<file>resource/systemicons/kylin-settings-network.png</file>
<file>resource/systemicons/kylin-settings-personalized.png</file>
<file>resource/systemicons/kylin-settings-search.png</file>
<file>resource/systemicons/kylin-settings-security.png</file>
<file>resource/systemicons/kylin-settings-system.png</file>
<file>resource/systemicons/kylin-settings-update.png</file>
<file>resource/time-cursor/left_ptr_watch_1.png</file>
<file>resource/background/controlcenter-light.png</file>
<file>resource/background/controlcenter-dark.png</file>
<file>resource/background/background-glazing.png</file>
<file>resource/background/background-dark.png</file>
<file>resource/background/background-light.png</file>
<file>resource/background/panel-dark.png</file>
<file>resource/background/panel-light.png</file>
<file>resource/background/homepage-cursor.png</file>
<file>resource/background/homepage-global.png</file>
<file>resource/background/homepage-icons.png</file>
<file>resource/systemicons/kylin-settings-commoninfo.png</file>
<file>resource/config/theme.conf</file>
<file>resource/debian/rules</file>
<file>resource/debian/copyright</file>
<file>resource/debian/source/format</file>
<file>resource/debian/postinst</file>
<file>resource/debian/postrm</file>
<file>resource/background/homepage-boot.png</file>
<file>resource/background/openKylin.svg</file>
<file>resource/background/grub-listview.png</file>
<file>resource/background/homepage-plymouth.png</file>
<file>resource/background/homepage-grub.png</file>
<file>resource/cursor/all-scroll.png</file>
<file>resource/cursor/bottom_tee.png</file>
<file>resource/cursor/circle.png</file>
<file>resource/cursor/left_ptr.png</file>
<file>resource/cursor/right_ptr.png</file>
<file>resource/cursor/color-picker.png</file>
<file>resource/cursor/cross.png</file>
<file>resource/cursor/dnd-ask.png</file>
<file>resource/cursor/dnd-copy.png</file>
<file>resource/cursor/dnd-link.png</file>
<file>resource/cursor/dnd-none.png</file>
<file>resource/cursor/dotbox.png</file>
<file>resource/cursor/h_double_arrow.png</file>
<file>resource/cursor/hand1.png</file>
<file>resource/cursor/hand2.png</file>
<file>resource/cursor/left_tee.png</file>
<file>resource/cursor/pencil.png</file>
<file>resource/cursor/plus.png</file>
<file>resource/cursor/right_tee.png</file>
<file>resource/cursor/sb_down_arrow.png</file>
<file>resource/cursor/sb_h_double_arrow.png</file>
<file>resource/cursor/sb_left_arrow.png</file>
<file>resource/cursor/sb_right_arrow.png</file>
<file>resource/cursor/sb_up_arrow.png</file>
<file>resource/cursor/sb_v_double_arrow.png</file>
<file>resource/cursor/tcross.png</file>
<file>resource/cursor/top_tee.png</file>
<file>resource/cursor/ul_angle.png</file>
<file>resource/cursor/ur_angle.png</file>
<file>resource/cursor/v_double_arrow.png</file>
<file>resource/cursor/vertical_text.png</file>
<file>resource/cursor/X_cursor.png</file>
<file>resource/cursor/xterm.png</file>
<file>resource/cursor/zoom-in.png</file>
<file>resource/cursor/zoom-out.png</file>
<file>resource/time-cursor/left_ptr_watch_2.png</file>
<file>resource/time-cursor/left_ptr_watch_3.png</file>
<file>resource/time-cursor/left_ptr_watch_4.png</file>
<file>resource/time-cursor/left_ptr_watch_5.png</file>
<file>resource/time-cursor/watch_1.png</file>
<file>resource/time-cursor/watch_2.png</file>
<file>resource/time-cursor/watch_3.png</file>
<file>resource/time-cursor/watch_4.png</file>
<file>resource/time-cursor/watch_5.png</file>
<file>resource/time-cursor/watch_6.png</file>
<file>resource/time-cursor/watch_7.png</file>
<file>resource/time-cursor/watch_8.png</file>
<file>resource/time-cursor/watch_9.png</file>
<file>resource/time-cursor/watch_10.png</file>
<file>resource/background/kylin.gif</file>
<file>resource/plymouth-other/logo.script</file>
<file>resource/plymouth-other/uk.png</file>
<file>resource/plymouth-other/password_field.png</file>
<file>resource/plymouth-other/progress_dot_off.png</file>
<file>resource/plymouth/104.png</file>
<file>resource/plymouth/103.png</file>
<file>resource/plymouth/102.png</file>
<file>resource/plymouth/101.png</file>
<file>resource/plymouth/100.png</file>
<file>resource/plymouth/99.png</file>
<file>resource/plymouth/98.png</file>
<file>resource/plymouth/97.png</file>
<file>resource/plymouth/96.png</file>
<file>resource/plymouth/95.png</file>
<file>resource/plymouth/94.png</file>
<file>resource/plymouth/93.png</file>
<file>resource/plymouth/92.png</file>
<file>resource/plymouth/91.png</file>
<file>resource/plymouth/90.png</file>
<file>resource/plymouth/89.png</file>
<file>resource/plymouth/88.png</file>
<file>resource/plymouth/87.png</file>
<file>resource/plymouth/86.png</file>
<file>resource/plymouth/85.png</file>
<file>resource/plymouth/84.png</file>
<file>resource/plymouth/83.png</file>
<file>resource/plymouth/82.png</file>
<file>resource/plymouth/81.png</file>
<file>resource/plymouth/80.png</file>
<file>resource/plymouth/79.png</file>
<file>resource/plymouth/78.png</file>
<file>resource/plymouth/77.png</file>
<file>resource/plymouth/76.png</file>
<file>resource/plymouth/75.png</file>
<file>resource/plymouth/74.png</file>
<file>resource/plymouth/73.png</file>
<file>resource/plymouth/72.png</file>
<file>resource/plymouth/71.png</file>
<file>resource/plymouth/70.png</file>
<file>resource/plymouth/69.png</file>
<file>resource/plymouth/68.png</file>
<file>resource/plymouth/67.png</file>
<file>resource/plymouth/66.png</file>
<file>resource/plymouth/65.png</file>
<file>resource/plymouth/64.png</file>
<file>resource/plymouth/63.png</file>
<file>resource/plymouth/62.png</file>
<file>resource/plymouth/61.png</file>
<file>resource/plymouth/60.png</file>
<file>resource/plymouth/59.png</file>
<file>resource/plymouth/58.png</file>
<file>resource/plymouth/57.png</file>
<file>resource/plymouth/56.png</file>
<file>resource/plymouth/55.png</file>
<file>resource/plymouth/54.png</file>
<file>resource/plymouth/53.png</file>
<file>resource/plymouth/52.png</file>
<file>resource/plymouth/51.png</file>
<file>resource/plymouth/50.png</file>
<file>resource/plymouth/49.png</file>
<file>resource/plymouth/48.png</file>
<file>resource/plymouth/47.png</file>
<file>resource/plymouth/46.png</file>
<file>resource/plymouth/45.png</file>
<file>resource/plymouth/44.png</file>
<file>resource/plymouth/43.png</file>
<file>resource/plymouth/42.png</file>
<file>resource/plymouth/41.png</file>
<file>resource/plymouth/40.png</file>
<file>resource/plymouth/39.png</file>
<file>resource/plymouth/38.png</file>
<file>resource/plymouth/37.png</file>
<file>resource/plymouth/36.png</file>
<file>resource/plymouth/35.png</file>
<file>resource/plymouth/34.png</file>
<file>resource/plymouth/33.png</file>
<file>resource/plymouth/32.png</file>
<file>resource/plymouth/31.png</file>
<file>resource/plymouth/30.png</file>
<file>resource/plymouth/29.png</file>
<file>resource/plymouth/28.png</file>
<file>resource/plymouth/27.png</file>
<file>resource/plymouth/26.png</file>
<file>resource/plymouth/25.png</file>
<file>resource/plymouth/24.png</file>
<file>resource/plymouth/23.png</file>
<file>resource/plymouth/22.png</file>
<file>resource/plymouth/21.png</file>
<file>resource/plymouth/20.png</file>
<file>resource/plymouth/19.png</file>
<file>resource/plymouth/18.png</file>
<file>resource/plymouth/17.png</file>
<file>resource/plymouth/16.png</file>
<file>resource/plymouth/15.png</file>
<file>resource/plymouth/14.png</file>
<file>resource/plymouth/13.png</file>
<file>resource/plymouth/12.png</file>
<file>resource/plymouth/11.png</file>
<file>resource/plymouth/10.png</file>
<file>resource/plymouth/9.png</file>
<file>resource/plymouth/8.png</file>
<file>resource/plymouth/7.png</file>
<file>resource/plymouth/6.png</file>
<file>resource/plymouth/5.png</file>
<file>resource/plymouth/4.png</file>
<file>resource/plymouth/3.png</file>
<file>resource/plymouth/2.png</file>
<file>resource/plymouth/1.png</file>
<file>resource/background/custom-preview.png</file>
<file>resource/background/1-openkylin.jpg</file>
<file>resource/background/grub-background.png</file>
<file>resource/config/json.txt</file>
<file>resource/blacklist.txt</file>
<file>resource/mimetypes/application-x-desktop.svg</file>
<file>resource/config/40_kylin-theme-builder.gschema.override</file>
<file>resource/config/kylin-theme-builder-change</file>
<file>resource/config/kylin-theme-builder-change.desktop</file>
<file>resource/config/kylin-theme-builder.txt</file>
<file>resource/config/theme-builder-change.conf</file>
<file>resource/devices/computer.png</file>
<file>resource/devices/cupsprinter.png</file>
<file>resource/devices/drive-harddisk.png</file>
<file>resource/devices/drive-removable-media-usb.png</file>
<file>resource/devices/input-keyboard.png</file>
<file>resource/devices/input-mouse.png</file>
<file>resource/devices/scanner.png</file>
<file>resource/places/document-open-recent.png</file>
<file>resource/places/folder-documents.png</file>
<file>resource/places/folder-download.png</file>
<file>resource/places/folder-dropbox.png</file>
<file>resource/places/folder-music.png</file>
<file>resource/places/folder-open.png</file>
<file>resource/places/folder-pictures.png</file>
<file>resource/places/folder-publicshare.png</file>
<file>resource/places/folder-templates.png</file>
<file>resource/places/folder-videos.png</file>
<file>resource/places/inode-directory.png</file>
<file>resource/places/user-desktop.png</file>
<file>resource/places/user-home.png</file>
<file>resource/places/user-trash-full.png</file>
<file>resource/places/user-trash.png</file>
<file>resource/theme.desktop</file>
<file>pics/bg@2x.png</file>
<file>pics/slogo-Drawing.svg</file>
<file>pics/AI-Drawing@2x.png</file>
<file>pics/loading.gif</file>
<file>pics/style/style-lolita@2x.png</file>
<file>pics/style/style-ancient@2x.png</file>
<file>pics/style/style-low-poly@2x.png</file>
<file>pics/style/style-watercolour.png</file>
<file>pics/style/style-baroque@2x.png</file>
<file>pics/style/style-surrealism@2x.png</file>
<file>pics/style/style-watercolour@2x.png</file>
<file>pics/style/style-futurism.png</file>
<file>pics/style/style-surrealism.png</file>
<file>pics/style/style-vaporwave.png</file>
<file>pics/style/style-oil-painting@2x.png</file>
<file>pics/style/style-ancient.png</file>
<file>pics/style/style-realistic@2x.png</file>
<file>pics/style/style-pixel@2x.png</file>
<file>pics/style/style-pixel.png</file>
<file>pics/style/style-futurism@2x.png</file>
<file>pics/style/style-vaporwave@2x.png</file>
<file>pics/style/style-baroque.png</file>
<file>pics/style/style-all@2x.png</file>
<file>pics/style/style-all.png</file>
<file>pics/style/style-anime@2x.png</file>
<file>pics/style/style-conceptual@2x.png</file>
<file>pics/style/style-ukiyoe.png</file>
<file>pics/style/style-cartoon@2x.png</file>
<file>pics/style/style-cyberpunk.png</file>
<file>pics/style/style-conceptual.png</file>
<file>pics/style/style-cartoon.png</file>
<file>pics/style/style-cyberpunk@2x.png</file>
<file>pics/style/style-ukiyoe@2x.png</file>
<file>pics/style/style-low-poly.png</file>
<file>pics/style/style-realistic.png</file>
<file>pics/style/style-oil-painting.png</file>
<file>pics/style/style-anime.png</file>
<file>pics/style/style-lolita.png</file>
</qresource>
</RCC>

1247
src/aithemebar.cpp Normal file

File diff suppressed because it is too large Load Diff

258
src/aithemebar.h Normal file
View File

@ -0,0 +1,258 @@
/*
Copyright (c) 2003-2007 Clarence Dang <dang@kde.org>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef KP_AI_DRAWINGBAR_H
#define KP_AI_DRAWINGBAR_H
#include <QWidget>
#include <QWidget>
#include <QPushButton>
#include <QButtonGroup>
#include <QLabel>
#include <QCheckBox>
#include <QVBoxLayout>
#include <QDialog>
#include <QPixmap>
#include <QStackedWidget>
#include <QScrollArea>
#include <QScrollBar>
#include <QPair>
#include <QList>
#include <QComboBox>
#include <QThread>
#include <QMouseEvent>
#include <QDebug>
#include <QJsonDocument>
#include <QJsonObject>
#include <QJsonArray>
#include <QDir>
#include <QGSettings>
#include <ai-base/modelconfig.h>
#include <ai-base/vision.h>
#include <kylin-ai/config.h>
// #define LOADING_IMAGE "/usr/share/kolourpaint/pics/loading.gif"
// #define BG_IMAGE "/usr/share/kolourpaint/pics/bg@2x.png"
// #define SLOGO_IMAGE "/usr/share/kolourpaint/pics/slogo-Drawing.svg"
// #define DRAWING_IMAGE "/usr/share/kolourpaint/pics/AI-Drawing@2x.png"
#define KYLIN_AI_DBUS "com.kylin.aiassistant"
#define KYLIN_AI_PATH "/com/kylin/aiassistant"
#define AI_GSETTINGS "org.kylin.aiassistant.settings"
#define AI_KEY "isVisionSetup"
const QString LOADING_IMAGE = ":/resource/loading.gif";
const QString BG_IMAGE = ":/resource/bg@2x.png";
const QString SLOGO_IMAGE = ":/resource/slogo-Drawing.svg";
const QString DRAWING_IMAGE = ":/resource/AI-Drawing@2x.png";
/**
* @brief The AIModeDataThread class
* 线AI的服务
*/
class AIModeDataThread : public QObject
{
Q_OBJECT
public:
AIModeDataThread();
~AIModeDataThread();
bool setSessionStatus();
VisionSession getVisionSession(){
return session;
}
bool someFunctionInThread();
void setAIData (QString str, QSize size, int quantity, VisionImageStyle Style){
textBox = str;
AIImageSize = size;
quantityNum = quantity;
ImageStyle = Style;
}
signals:
void finishedSignal(bool flag, QPixmap pixmap, int imageIndex, int imageSum, int errorCode);
private:
void sendErrorSignal(int ret){
emit finishedSignal(false, QPixmap(), 0, 1, ret);
for(int i = 0; i < quantityNum; i++)
emit finishedSignal(true, QPixmap(), i, quantityNum, ret);
}
static void generateImageCallback(VisionImageData imageData, void* userData);
private:
QPixmap pixmap;
int quantityNum = 1; //数量按钮
QSize AIImageSize;
QString textBox;
VisionImageStyle ImageStyle;
bool m_sessionFlag = false;
VisionSession session;
};
/**
* @brief The imageClickableLabel class
* QLabel点击事件类
*/
class imageClickableLabel : public QLabel
{
Q_OBJECT
signals:
void labelClicked(const QPixmap &pixmap);
public:
imageClickableLabel(const QPixmap &pixmap, QWidget *parent = nullptr) : QLabel(parent), pixmap(pixmap){}
protected:
void mousePressEvent(QMouseEvent *event) override
{
Q_UNUSED(event);
emit labelClicked(pixmap);
}
private:
QPixmap pixmap;
};
class aithemebar : public QWidget
{
Q_OBJECT
signals:
void imageClicked(const QPixmap &pixmap);
public:
aithemebar(QWidget *parent);
~aithemebar();
public:
void initUI();
bool getConfigStatus();
void getconfigVersionData();
void loginConfigurationPage();
void setAiPixmap(QPixmap pixmap,int imageIndex, QGridLayout *pageLayout);
void updatePageLabel();
QSize getImageLabelSize();
bool eventFilter(QObject *watched, QEvent *event);
void handleLabelClicked(QObject *clickedObject);
QPixmap createPixmapWithText(const QString &text);
QPixmap AIGeneratesErrorHandling(int errorCode);
private slots:
void onConfigButtonClicked(); //配置按钮回调函数
void onConfigSettingsChange(const QString &key); //AI配置成功后回调
void onGenerateButtonClicked(); //生成按钮回调函数
void handleInputTextChanged(); //文字变化回调函数
void showPreviousPage(); //显示上一页
void showNextPage(); //显示下一页
void deleteCurrentPage();
void setEnabledDeleteButton();
void handleLabelClick(const QPixmap &pixmap);
void addPageAndStoreImages();
void onStyleMoreButtonClick();
void startThread() {
if (m_AiMode->setSessionStatus()){
m_AiMode->setAIData(textBox, AIImageSize, quantityNum, ImageStyle);
m_AiMode->someFunctionInThread();
}
}
void onThreadFinished(bool flag, QPixmap pixmap, int imageIndex, int imageSum, int errorCode);
private:
void updateImageGrid();
void updateResultGrid();
void deleteImageGridWidget();
void addResolutionComboBox();
void addQuantityComboBox();
QJsonArray readResolutionsFromJson(QString key);
int readNumFromJson(QString key);
QWidget *addAllStyleLabel(QString iconPath, QString labelText, int line);
QWidget *addStyleLabel(QString iconPath, QString labelText, int line);
void addStyleWidget();
void addStyleGrid(QWidget *widget, int line);
private:
int imageColumn = 2;//显示列表列数
int quantityNum = 1; //数量按钮
int show_quantityNum = 1; //数量按钮
int currentPageIndx = -1;//切换页第几页
bool styleFlag; //风格标志位,用于判断按下哪一个风格
bool deleteButtonFlag = true;
bool buildButtonFlag;
QGSettings *AiSettings; //监听配置信息
QSize AIImageSize; //图片大小
QSize showAIImageSize;
QMovie *movie = nullptr;//生成等待图标
QLabel *resultLabel; //生成结果 label
QLabel *pageLabel; //第几页面label
QLabel *selectedIconLabel;//风格图片选择Label
QLabel *selectedTextLabel;//风格文字选择Label
QWidget *configWidget; //立即配置页面
QWidget *widget_low_poly; //多边形风格
QString textBox; //图像描述文字
QString colorfulButtonStyle; //立即生成按钮渐变色
QString colorGrayButtonStyle;//立即生成按钮置灰
QBoxLayout *vbox; //页面布局
QHBoxLayout *resultGrid; //生成结果布局
QGridLayout *styleGrid; //风格布局
QPushButton *moreButton; //更多按钮
QScrollArea *scrollArea; //滚动窗口
QPushButton *buildButton; //立即生成按钮
QPushButton *deleteButton; //删除按钮
QComboBox *resolutionComboBox; //图像分辨率
QComboBox *quantityComboBox; //生成数量
QStackedWidget *stackedWidget; //生成结果的换页窗口
QVector<QVector<QPixmap>> imagesVector; //生成图像数据集成
VisionSession mSession = nullptr;
VisionImageStyle ImageStyle; //风格样式
AIModeDataThread *m_AiMode; //AI生成程序
};
#endif

View File

@ -153,8 +153,8 @@ void MainWindow::initUI()
// this->setPalette(palette);
this->setBackgroundRole(QPalette::Base);
this->setAutoFillBackground(true);
this->setMinimumSize(1280, 720);
// this->setMinimumSize(1280, 720);
this->setMinimumSize(1600, 900);
m_maininterface = new MainInterface();
m_entrywidget = new QWidget();

View File

@ -37,14 +37,23 @@ GlobalThemeWidget::GlobalThemeWidget(QWidget *parent) : QWidget(parent)
initPreviewWidget();
initRightWidget();
QPushButton *line = new QPushButton();
line->setDisabled(true);
line->setFixedWidth(1);
line->setFixedHeight(2000);
QPushButton *line1 = new QPushButton();
line1->setDisabled(true);
line1->setFixedWidth(1);
line1->setFixedHeight(2000);
QPushButton *line2 = new QPushButton();
line2->setDisabled(true);
line2->setFixedWidth(1);
line2->setFixedHeight(2000);
m_globalthemelayout = new QHBoxLayout();
m_globalthemelayout->addWidget(m_previewwidget);
m_globalthemelayout->addWidget(line);
m_globalthemelayout->addWidget(line1);
m_globalthemelayout->addWidget(m_rightwidget);
m_globalthemelayout->addWidget(line2);
initAithemeBar();
m_globalthemelayout->setContentsMargins(0,0,0,0);
m_globalthemelayout->setSpacing(0);
@ -168,6 +177,34 @@ void GlobalThemeWidget::initPreviewWidget()
m_previewwidget->setLayout(m_previewlayout);
}
/**
* @brief Ai生图小部件
* QWidgetgrub布局
* label clicked
*/
void GlobalThemeWidget::initAithemeBar()
{
// 创建 aithemebar 实例
m_aithemebar = new aithemebar(this);
m_aithemebar->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
// 设置最小和最大宽度
m_aithemebar->setMinimumSize(250, 620);
m_aithemebar->setMaximumWidth(250);
m_aithemebar->setBackgroundRole(QPalette::Base);
m_aithemebar->setAutoFillBackground(true);
// 设置 aithemebar 的固定宽度
m_aithemebar->setFixedWidth(250);
// 在布局中为 aithemebar 分配足够的空间
QSpacerItem *spacer = new QSpacerItem(15, 0, QSizePolicy::Fixed, QSizePolicy::Minimum);
m_globalthemelayout->addItem(spacer);
m_globalthemelayout->addWidget(m_aithemebar);
connect(m_aithemebar, &aithemebar::imageClicked, this, &GlobalThemeWidget::updateAIImage);
}
/**
* @brief
*
@ -903,6 +940,45 @@ void GlobalThemeWidget::setWindowRadius(int windowradius)
}
}
void GlobalThemeWidget::updateAIImage(const QPixmap &pixmap)
{
// 生成唯一的临时文件路径
QString tempPath = QString("/tmp/temp_image_%1.png").arg(QUuid::createUuid().toString(QUuid::WithoutBraces));
// 固定预览窗口的尺寸为 3840x2160
QSize previewSize(3840, 2160);
// 调整 QPixmap 的尺寸以适应预览窗口
QPixmap scaledPixmap = pixmap.scaled(previewSize, Qt::KeepAspectRatio, Qt::SmoothTransformation);
// 将调整后的 QPixmap 保存到临时文件
scaledPixmap.save(tempPath);
// 将临时文件路径添加到列表中
tempFilePaths.append(tempPath);
m_preview->updateWallpaper(tempPath);
emit wallpaperupdate(tempPath);
emit newWallpaperFilePath(tempPath);
QPixmap pixmap1(tempPath);
wallpaperbtn->setIcon(QIcon(pixmap1));
wallpaperbtn->setIconSize(QSize(178,122));
m_themeChangeMap->insert("wallpaper",true);
emit globalthemeChange(m_themeChangeMap);
// 更新预览窗口的背景图片
// updateWallpaper(tempPath);
// 将 QPixmap 设置为按钮的图标
// m_showBtn->setIcon(QIcon(pixmap));
// setWallpaper(tempPath);
// 设置按钮图标的大小
// m_showBtn->setIconSize(QSize(178, 122));
}
void GlobalThemeWidget::useMaximumScale()
{
m_preview->maxscale();

View File

@ -21,6 +21,7 @@
#define GLOBALTHEMEWIDGET_H
#include "globalthemefeature.h"
#include "../fileProcess/datacollect.h"
#include "../aithemebar.h"
#include <QObject>
#include <QWidget>
#include <QPushButton>
@ -53,6 +54,7 @@ public:
QMap<QString, bool> *m_globalPresenceMap;
void useMaximumScale();
void useRestoreScale();
void updateAIImage(const QPixmap &pixmap);
signals:
void wallpaperupdate(const QString& filePath);
void newWallpaperFilePath(const QString& path);
@ -66,6 +68,7 @@ signals:
void build();
private:
void initPreviewWidget();
void initAithemeBar();
void initRightWidget();
void initCoverWidget();
@ -111,6 +114,8 @@ private:
EditButton *wallpaperbtn;
BasePreviewWidget *m_previewwidget;
GlobalImageWidget *m_preview;
aithemebar *m_aithemebar;
QList<QString> tempFilePaths;
};
#endif // GLOBALTHEMEWIDGET_H

View File

@ -20,6 +20,8 @@
#include "grubthemewidget.h"
#include "../fileProcess/filecheck.h"
#include <QFileDialog>
#include "../aithemebar.h"
#include <QMainWindow>
bool GrubThemeWidget::g_themeChange;
/**
@ -33,20 +35,34 @@ GrubThemeWidget::GrubThemeWidget(QWidget *parent) : QWidget(parent)
{
initPreviewWidget();
initRightWidget();
QHBoxLayout *grubthemelayout = new QHBoxLayout();
QPushButton *line = new QPushButton();
line->setDisabled(true);
line->setFixedWidth(1);
line->setFixedHeight(2000);
grubthemelayout->addWidget(m_previewwidget);
grubthemelayout->addWidget(line);
grubthemelayout->addWidget(m_rightwidget);
m_grubthemelayout = new QHBoxLayout();
// grubthemelayout->setSizeConstraint(QLayout::SetMinimumSize);
QPushButton *line1 = new QPushButton();
line1->setDisabled(true);
line1->setFixedWidth(1);
line1->setFixedHeight(2000);
grubthemelayout->setContentsMargins(0,0,0,0);
grubthemelayout->setSpacing(0);
QPushButton *line2 = new QPushButton();
line2->setDisabled(true);
line2->setFixedWidth(1);
line2->setFixedHeight(2000);
this->setLayout(grubthemelayout);
// 主布局添加控件
// m_grubthemelayout->addStretch(1);
m_grubthemelayout->addWidget(m_previewwidget);
m_grubthemelayout->addWidget(line1); // 分割线
m_grubthemelayout->addWidget(m_rightwidget);
m_grubthemelayout->addWidget(line2); // 分割线
initAithemeBar();
// m_grubthemelayout->addWidget(m_aithemebar);
// m_grubthemelayout->addStretch(1);
m_grubthemelayout->setContentsMargins(0,0,0,0);
m_grubthemelayout->setSpacing(0);
this->setLayout(m_grubthemelayout);
}
/**
@ -73,6 +89,35 @@ void GrubThemeWidget::initPreviewWidget()
m_previewwidget->setLayout(m_previewlayout);
}
/**
* @brief Ai生图小部件
* QWidgetgrub布局
* label clicked
*/
void GrubThemeWidget::initAithemeBar()
{
// 创建 aithemebar 实例
m_aithemebar = new aithemebar(this);
m_aithemebar->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
// 设置最小和最大宽度
m_aithemebar->setMinimumSize(250, 620);
m_aithemebar->setMaximumWidth(250);
m_aithemebar->setBackgroundRole(QPalette::Base);
m_aithemebar->setAutoFillBackground(true);
// 设置 aithemebar 的固定宽度
m_aithemebar->setFixedWidth(250);
// 在布局中为 aithemebar 分配足够的空间
QSpacerItem *spacer = new QSpacerItem(15, 0, QSizePolicy::Fixed, QSizePolicy::Minimum);
m_grubthemelayout->addItem(spacer);
m_grubthemelayout->addWidget(m_aithemebar);
connect(m_aithemebar, &aithemebar::imageClicked, this, &GrubThemeWidget::updateAIImage);
}
/**
* @brief
*
@ -88,6 +133,7 @@ void GrubThemeWidget::initRightWidget()
m_rightwidget->setMaximumWidth(400);
m_rightwidget->setBackgroundRole(QPalette::Base);
m_rightwidget->setAutoFillBackground(true);
QVBoxLayout *layout = new QVBoxLayout(m_rightwidget);
layout->setContentsMargins(0,0,0,0);
initEditWidget();
@ -134,7 +180,7 @@ void GrubThemeWidget::initEditWidget()
grubAddPicWidget *a = new grubAddPicWidget();
QHBoxLayout *importlayout = new QHBoxLayout();
importlayout->addStretch(1);
importlayout->addStretch(1);
importlayout->addWidget(m_showBtn);
importlayout->addStretch(1);
importlayout->addWidget(a);
@ -229,6 +275,52 @@ void GrubThemeWidget::refresh()
m_showBtn->setIconSize(QSize(178,122));
}
// void GrubThemeWidget::updateAIImage(const QPixmap &pixmap)
// {
// m_preview->updateBackground(resourceGrubPath);
// QPixmap pixmap(resourceGrubPath);
// m_showBtn->setIcon(QIcon(pixmap));
// m_showBtn->setIconSize(QSize(178,122));
// }
void GrubThemeWidget::updateAIImage(const QPixmap &pixmap)
{
// 生成唯一的临时文件路径
QString tempPath = QString("/tmp/temp_image_%1.png").arg(QUuid::createUuid().toString(QUuid::WithoutBraces));
// 固定预览窗口的尺寸为 3840x2160
QSize previewSize(3840, 2160);
// 调整 QPixmap 的尺寸以适应预览窗口
QPixmap scaledPixmap = pixmap.scaled(previewSize, Qt::KeepAspectRatio, Qt::SmoothTransformation);
// 将调整后的 QPixmap 保存到临时文件
scaledPixmap.save(tempPath);
// 将临时文件路径添加到列表中
tempFilePaths.append(tempPath);
// 更新预览窗口的背景图片
m_preview->updateBackground(tempPath);
// 将 QPixmap 设置为按钮的图标
m_showBtn->setIcon(QIcon(pixmap));
// 设置按钮图标的大小
m_showBtn->setIconSize(QSize(178, 122));
}
void GrubThemeWidget::clearTempFiles()
{
// 删除所有临时文件
for (const QString &filePath : tempFilePaths) {
QFile::remove(filePath);
}
// 清空临时文件路径列表
tempFilePaths.clear();
}
void GrubThemeWidget::useMaximumScale()
{
m_preview->maxscale();
@ -250,15 +342,5 @@ void GrubThemeWidget::setBuildBtnText(bool isglobal)
void GrubThemeWidget::addspaceritem()
{
QSpacerItem *spacer = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Expanding);
QSpacerItem *spacer2 = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Expanding);
spacer->changeSize(m_previewwidget->width(), 155, QSizePolicy::Maximum, QSizePolicy::Maximum);
spacer2->changeSize(m_previewwidget->width(), 159, QSizePolicy::Maximum, QSizePolicy::Maximum);
// m_previewlayout->addItem(spacer);
m_previewlayout->addWidget(m_preview);
// m_previewlayout->addItem(spacer2);
}

View File

@ -23,6 +23,7 @@
#include "grubthemefeature.h"
#include "historywidget.h"
#include "basewidget.h"
#include "../aithemebar.h"
#include <QObject>
#include <QWidget>
@ -39,14 +40,18 @@ public:
explicit GrubThemeWidget(QWidget *parent = nullptr);
void initPreviewWidget();
void initRightWidget();
void initAithemeBar();
void addspaceritem();
void initEditWidget();
void initEditWidget();
void initBuildWidget();
static bool g_themeChange;
void eidtInitWidget(const HistoryInfo &InfoData);
void refresh();
void updateAIImage(const QPixmap &pixmap);
// void updateAIImage();
void useMaximumScale();
void useRestoreScale();
void clearTempFiles();
void setBuildBtnText(bool isglobal);
signals:
void newGrubFilePath(const QString& path);
@ -56,11 +61,15 @@ private:
BasePreviewWidget *m_previewwidget;
GrubImageWidget *m_preview;
QWidget *m_rightwidget;
QHBoxLayout *m_grubthemelayout;
QWidget *m_grubwidget;
QWidget *m_buildwidget;
aithemebar *m_aithemebar;
QVBoxLayout *m_previewlayout;
GrubEditButton *m_showBtn;
QPushButton *m_buildButton;
// 声明并初始化 tempFilePaths 列表
QList<QString> tempFilePaths;
};
#endif // GRUBTHEMEWIDGET_H

View File

@ -32,15 +32,22 @@ PlymouthThemeWidget::PlymouthThemeWidget(QWidget *parent) : QWidget(parent)
{
initPreviewWidget();
initRightWidget();
QHBoxLayout *plymouththemelayout = new QHBoxLayout();
plymouththemelayout = new QHBoxLayout();
QPushButton *line = new QPushButton();
line->setDisabled(true);
line->setFixedWidth(1);
line->setFixedHeight(2000);
QPushButton *line1 = new QPushButton();
line1->setDisabled(true);
line1->setFixedWidth(1);
line1->setFixedHeight(2000);
QPushButton *line2 = new QPushButton();
line2->setDisabled(true);
line2->setFixedWidth(1);
line2->setFixedHeight(2000);
plymouththemelayout->addWidget(m_previewwidget);
plymouththemelayout->addWidget(line);
plymouththemelayout->addWidget(line1);
plymouththemelayout->addWidget(m_rightwidget);
plymouththemelayout->addWidget(line2);
initAithemeBar();
plymouththemelayout->setContentsMargins(0,0,0,0);
@ -72,6 +79,34 @@ void PlymouthThemeWidget::initPreviewWidget()
m_previewwidget->setLayout(m_previewlayout);
}
/**
* @brief Ai生图小部件
* QWidgetgrub布局
* label clicked
*/
void PlymouthThemeWidget::initAithemeBar()
{
// 创建 aithemebar 实例
m_aithemebar = new aithemebar(this);
m_aithemebar->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
// 设置最小和最大宽度
m_aithemebar->setMinimumSize(250, 620);
m_aithemebar->setMaximumWidth(250);
m_aithemebar->setBackgroundRole(QPalette::Base);
m_aithemebar->setAutoFillBackground(true);
// 设置 aithemebar 的固定宽度
m_aithemebar->setFixedWidth(250);
// 在布局中为 aithemebar 分配足够的空间
QSpacerItem *spacer = new QSpacerItem(15, 0, QSizePolicy::Fixed, QSizePolicy::Minimum);
plymouththemelayout->addItem(spacer);
plymouththemelayout->addWidget(m_aithemebar);
connect(m_aithemebar, &aithemebar::imageClicked, this, &PlymouthThemeWidget::updateAIImage);
}
/**
* @brief
*
@ -313,6 +348,35 @@ void PlymouthThemeWidget::refresh()
m_customLabel->setPixmap(QPixmap());
}
void PlymouthThemeWidget::updateAIImage(const QPixmap &pixmap)
{
// 生成唯一的临时文件路径
QString tempPath = QString("/tmp/temp_image_%1.png").arg(QUuid::createUuid().toString(QUuid::WithoutBraces));
// 固定预览窗口的尺寸为 400x400
QSize previewSize(400, 400);
// 调整 QPixmap 的尺寸以适应预览窗口
QPixmap scaledPixmap = pixmap.scaled(previewSize, Qt::KeepAspectRatio, Qt::SmoothTransformation);
// 将调整后的 QPixmap 保存到临时文件
scaledPixmap.save(tempPath);
// 将临时文件路径添加到列表中
tempFilePaths.append(tempPath);
// 更新预览窗口的背景图片
m_preview->updatePlymouth(tempPath);
m_preview->showPlymouth();
// 将 QPixmap 设置为按钮的图标
// m_showBtn->setIcon(QIcon(pixmap));
m_customLabel->setPixmap(QPixmap(pixmap));
// 设置按钮图标的大小
// m_showBtn->setIconSize(QSize(178, 122));
}
void PlymouthThemeWidget::useMaximumScale()
{
m_preview->maxscale();

View File

@ -24,6 +24,7 @@
#include "historywidget.h"
#include "basewidget.h"
#include "../fileProcess/filecheck.h"
#include "../aithemebar.h"
#include <QObject>
#include <QWidget>
@ -39,6 +40,7 @@ class PlymouthThemeWidget : public QWidget
public:
explicit PlymouthThemeWidget(QWidget *parent = nullptr);
void initPreviewWidget();
void initAithemeBar();
void initRightWidget();
void addspaceritem();
void initEditWidget();
@ -48,6 +50,7 @@ public:
void startShowPlymouth();
void eidtInitWidget(const HistoryInfo &InfoData);
void refresh();
void updateAIImage(const QPixmap &pixmap);
void useMaximumScale();
void useRestoreScale();
void setBuildBtnText(bool isglobal);
@ -62,6 +65,7 @@ private:
QWidget *m_plymouthwidget;
QWidget *m_buildwidget;
QVBoxLayout *m_previewlayout;
QHBoxLayout *plymouththemelayout;
PlymouthCustomLabel *m_customLabel;
QString m_imagedirpath;
QRadioButton *pic;
@ -69,6 +73,8 @@ private:
QRadioButton *video;
QLabel *videoLabel;
QPushButton *m_buildButton;
aithemebar *m_aithemebar;
QList<QString> tempFilePaths;
};
#endif // PLYMOUTHMOUTHTHEMEWIDGET_H