diff options
author | Mavridis Philippe <mavridisf@gmail.com> | 2023-10-29 14:54:54 +0200 |
---|---|---|
committer | Mavridis Philippe <mavridisf@gmail.com> | 2023-10-29 15:12:37 +0200 |
commit | 8a05c7576b3cea2a191a7f13b9ef3e7853e68c74 (patch) | |
tree | d7f0d13ce0eda48a52911c98b90891b239b7699b | |
parent | a524c4c5c678bce1849428515d41ac5fe3a45ee3 (diff) | |
download | tastymenu-8a05c7576b3cea2a191a7f13b9ef3e7853e68c74.tar.gz tastymenu-8a05c7576b3cea2a191a7f13b9ef3e7853e68c74.zip |
Added "Follow Kicker panel style" feature
This option overrides existing TastyMenu-specific transparency and blur options by using the appearance options for Kicker (transparency, blur, tint).
This option works with both Kicker transparency enabled and disabled but ignores the background image option by design.
Signed-off-by: Mavridis Philippe <mavridisf@gmail.com>
-rw-r--r-- | src/appearance.ui | 100 | ||||
-rw-r--r-- | src/menuhandler.cpp | 30 | ||||
-rw-r--r-- | src/menuhandler.h | 3 | ||||
-rw-r--r-- | src/tastymenu.kcfg | 5 |
4 files changed, 97 insertions, 41 deletions
diff --git a/src/appearance.ui b/src/appearance.ui index ef4728a..99fad35 100644 --- a/src/appearance.ui +++ b/src/appearance.ui @@ -9,7 +9,7 @@ <x>0</x> <y>0</y> <width>647</width> - <height>734</height> + <height>608</height> </rect> </property> <property name="caption"> @@ -19,7 +19,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="TQLabel" row="4" column="0" rowspan="1" colspan="5"> + <widget class="TQLabel" row="4" column="0" rowspan="1" colspan="3"> <property name="name"> <cstring>menuSize</cstring> </property> @@ -35,7 +35,7 @@ <set>AlignBottom</set> </property> </widget> - <widget class="TQLabel" row="6" column="0" rowspan="1" colspan="5"> + <widget class="TQLabel" row="6" column="0" rowspan="1" colspan="3"> <property name="name"> <cstring>menuStyleLabel</cstring> </property> @@ -51,7 +51,7 @@ <set>AlignBottom</set> </property> </widget> - <widget class="TQLabel" row="0" column="0" rowspan="1" colspan="3"> + <widget class="TQLabel" row="0" column="0" rowspan="1" colspan="2"> <property name="name"> <cstring>Icons</cstring> </property> @@ -67,7 +67,7 @@ <set>AlignBottom</set> </property> </widget> - <widget class="TQLabel" row="2" column="0" rowspan="1" colspan="3"> + <widget class="TQLabel" row="2" column="0" rowspan="1" colspan="2"> <property name="name"> <cstring>MenuButton</cstring> </property> @@ -83,7 +83,7 @@ <set>AlignBottom</set> </property> </widget> - <widget class="TQLayoutWidget" row="1" column="1" rowspan="1" colspan="3"> + <widget class="TQLayoutWidget" row="1" column="1"> <property name="name"> <cstring>layout2</cstring> </property> @@ -281,7 +281,7 @@ </size> </property> </spacer> - <spacer row="1" column="4"> + <spacer row="1" column="2"> <property name="name"> <cstring>spacer6_2</cstring> </property> @@ -315,7 +315,7 @@ </size> </property> </spacer> - <widget class="TQLayoutWidget" row="3" column="2"> + <widget class="TQLayoutWidget" row="3" column="1"> <property name="name"> <cstring>layout3</cstring> </property> @@ -508,7 +508,7 @@ Empty means default.</string> </widget> </grid> </widget> - <spacer row="3" column="3" rowspan="1" colspan="2"> + <spacer row="3" column="2"> <property name="name"> <cstring>spacer6_4</cstring> </property> @@ -525,7 +525,7 @@ Empty means default.</string> </size> </property> </spacer> - <widget class="TQLayoutWidget" row="5" column="2"> + <widget class="TQLayoutWidget" row="5" column="1"> <property name="name"> <cstring>layout4</cstring> </property> @@ -638,7 +638,7 @@ Empty means default.</string> </size> </property> </spacer> - <spacer row="5" column="4"> + <spacer row="5" column="2"> <property name="name"> <cstring>spacer6_6</cstring> </property> @@ -655,33 +655,7 @@ Empty means default.</string> </size> </property> </spacer> - <widget class="TQLayoutWidget" row="7" column="2"> - <property name="name"> - <cstring>layout5</cstring> - </property> - <grid> - <property name="name"> - <cstring>unnamed</cstring> - </property> - <widget class="TQCheckBox" row="0" column="0"> - <property name="name"> - <cstring>kcfg_Transparent</cstring> - </property> - <property name="text"> - <string>Transparent background</string> - </property> - </widget> - <widget class="TQCheckBox" row="1" column="0"> - <property name="name"> - <cstring>kcfg_BlurBackground</cstring> - </property> - <property name="text"> - <string>Blur transparent background</string> - </property> - </widget> - </grid> - </widget> - <spacer row="7" column="0" rowspan="1" colspan="2"> + <spacer row="7" column="0"> <property name="name"> <cstring>spacer6_7</cstring> </property> @@ -698,7 +672,7 @@ Empty means default.</string> </size> </property> </spacer> - <spacer row="7" column="3" rowspan="1" colspan="2"> + <spacer row="7" column="2"> <property name="name"> <cstring>spacer6_7_2</cstring> </property> @@ -715,8 +689,44 @@ Empty means default.</string> </size> </property> </spacer> + <widget class="TQLayoutWidget" row="7" column="1"> + <property name="name"> + <cstring>layout6</cstring> + </property> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="TQCheckBox"> + <property name="name"> + <cstring>kcfg_Transparent</cstring> + </property> + <property name="text"> + <string>Transparent background</string> + </property> + </widget> + <widget class="TQCheckBox"> + <property name="name"> + <cstring>kcfg_BlurBackground</cstring> + </property> + <property name="text"> + <string>Blur transparent background</string> + </property> + </widget> + <widget class="TQCheckBox"> + <property name="name"> + <cstring>kcfg_UseKickerStyle</cstring> + </property> + <property name="text"> + <string>Follow Kicker panel style</string> + </property> + </widget> + </vbox> + </widget> </grid> </widget> +<customwidgets> +</customwidgets> <connections> <connection> <sender>kcfg_MenuButtonText</sender> @@ -748,6 +758,18 @@ Empty means default.</string> <receiver>Appearance</receiver> <slot>iconChanged(TQString)</slot> </connection> + <connection> + <sender>kcfg_UseKickerStyle</sender> + <signal>toggled(bool)</signal> + <receiver>kcfg_BlurBackground</receiver> + <slot>setDisabled(bool)</slot> + </connection> + <connection> + <sender>kcfg_UseKickerStyle</sender> + <signal>toggled(bool)</signal> + <receiver>kcfg_Transparent</receiver> + <slot>setDisabled(bool)</slot> + </connection> </connections> <includes> <include location="global" impldecl="in implementation">kicondialog.h</include> diff --git a/src/menuhandler.cpp b/src/menuhandler.cpp index 1899029..f461e7c 100644 --- a/src/menuhandler.cpp +++ b/src/menuhandler.cpp @@ -1150,6 +1150,7 @@ void MenuHandler::slotModKickerConf() fillMoreUsed(); else if( currentMenuMode == RecentlyUsed ) fillRecentlyUsed(); + setBackground(); } @@ -1703,10 +1704,17 @@ void MenuHandler::setBackground() rootPix = nullptr; } - if (prefSkel->transparent()) { + if (isTransparent()) { rootPix = new KRootPixmap(this); rootPix->setCustomPainting(true); - rootPix->setBlurEffect(0.0, prefSkel->blurBackground() ? 4.0 : 0.0); + rootPix->setBlurEffect(0.0, isBlurred() ? 4.0 : 0.0); + + if (prefSkel->useKickerStyle()) { + kickerConf->setGroup("General"); + double tint = double(kickerConf->readDoubleNumEntry("TintValue")) / 100; + rootPix->setFadeEffect(tint, kickerConf->readColorEntry("TintColor")); + } + connect(rootPix, TQT_SIGNAL(backgroundUpdated(const TQPixmap&)), TQT_SLOT(updateBackground(const TQPixmap&))); rootPix->start(); @@ -1718,5 +1726,23 @@ void MenuHandler::updateBackground(const TQPixmap &pix) menu->setPaletteBackgroundPixmap(pix); } +bool MenuHandler::isTransparent() +{ + if (prefSkel->useKickerStyle()) { + kickerConf->setGroup("General"); + return kickerConf->readBoolEntry("Transparent", false); + } + return prefSkel->transparent(); +} + +bool MenuHandler::isBlurred() +{ + if (prefSkel->useKickerStyle()) { + kickerConf->setGroup("General"); + return kickerConf->readBoolEntry("MenubarPanelBlurred", false); + } + return prefSkel->blurBackground(); +} + #include "menuhandler.moc" //EOF diff --git a/src/menuhandler.h b/src/menuhandler.h index e020f60..d430c12 100644 --- a/src/menuhandler.h +++ b/src/menuhandler.h @@ -69,6 +69,9 @@ public: prefSkel->setNewInstalledApps( newInstalledList ); prefSkel->setNewInstalledAppsTimeStamps( newInstalledTimeStamps );} + bool isTransparent(); + bool isBlurred(); + signals: void newApplications(int); void kickerConfChanged(); diff --git a/src/tastymenu.kcfg b/src/tastymenu.kcfg index e896a36..8e0b664 100644 --- a/src/tastymenu.kcfg +++ b/src/tastymenu.kcfg @@ -111,6 +111,11 @@ <label>Blur background</label> <default>false</default> </entry> + + <entry name="UseKickerStyle" type="Bool"> + <label>Follow Kicker panel style</label> + <default>false</default> + </entry> </group> <group name="Behaviour"> |