summaryrefslogtreecommitdiffstats
path: root/kicker/applets/minipager
diff options
context:
space:
mode:
authorMavridis Philippe <mavridisf@gmail.com>2025-01-14 19:42:04 +0200
committerPhilippe Mavridis <philippe.mavridis@yandex.com>2025-07-06 11:24:54 +0300
commite3814d806d9ca5afd9181e45f4808f0773073c75 (patch)
treed09b11f2232061691bc9b93b548acbc354160422 /kicker/applets/minipager
parent2f42993e2197a2b1b87597d2f3722a23f075c263 (diff)
downloadtdebase-e3814d80.tar.gz
tdebase-e3814d80.zip
Kicker: aesthetic improvements
* New icon margin option for the system tray applet * Panel blur effect strength is now configurable * 3D border option tin minipager * Ability to rename desktops when minipager label not displaying desktop name Signed-off-by: Philippe Mavridis <philippe.mavridis@yandex.com> (cherry picked from commit fa284a459858f2255c485240121f7cd1cc7d17a0)
Diffstat (limited to 'kicker/applets/minipager')
-rw-r--r--kicker/applets/minipager/pagerapplet.cpp12
-rw-r--r--kicker/applets/minipager/pagerapplet.h3
-rw-r--r--kicker/applets/minipager/pagerbutton.cpp112
-rw-r--r--kicker/applets/minipager/pagersettings.kcfg9
4 files changed, 67 insertions, 69 deletions
diff --git a/kicker/applets/minipager/pagerapplet.cpp b/kicker/applets/minipager/pagerapplet.cpp
index 003df72fc..1d3a70025 100644
--- a/kicker/applets/minipager/pagerapplet.cpp
+++ b/kicker/applets/minipager/pagerapplet.cpp
@@ -442,7 +442,7 @@ void KMiniPager::wheelEvent( TQWheelEvent* e )
{
int newDesk;
int desktops = KWin::numberOfDesktops();
-
+
if(cycleWindow()){
@@ -456,7 +456,7 @@ void KMiniPager::wheelEvent( TQWheelEvent* e )
{
newDesk = (desktops + m_curDesk - 2) % desktops + 1;
}
-
+
slotButtonSelected(newDesk);
}
}
@@ -735,6 +735,7 @@ void KMiniPager::aboutToShowContextMenu()
showMenu->insertItem(i18n("&Window Thumbnails"), WindowThumbnails);
showMenu->insertItem(i18n("&Window Icons"), WindowIcons);
showMenu->insertItem(i18n("&Cycle on Wheel"), Cycle);
+ showMenu->insertItem(i18n("3&D Desk Borders"), Border3D);
showMenu->insertTitle(i18n("Text Label"));
showMenu->insertItem(i18n("Desktop N&umber"),
@@ -767,10 +768,8 @@ void KMiniPager::aboutToShowContextMenu()
m_contextMenu->setItemChecked(WindowThumbnails, m_settings->preview());
m_contextMenu->setItemChecked(WindowIcons, m_settings->icons());
m_contextMenu->setItemChecked(Cycle, m_settings->cycle());
+ m_contextMenu->setItemChecked(Border3D, m_settings->border3D());
m_contextMenu->setItemEnabled(WindowIcons, m_settings->preview());
- m_contextMenu->setItemEnabled(RenameDesktop,
- m_settings->labelType() ==
- PagerSettings::EnumLabelType::LabelName);
}
void KMiniPager::slotShowMenu(const TQPoint& pos, int desktop)
@@ -822,6 +821,9 @@ void KMiniPager::contextMenuActivated(int result)
case Cycle:
m_settings->setCycle(!m_settings->cycle());
break;
+ case Border3D:
+ m_settings->setBorder3D(!m_settings->border3D());
+ break;
case WindowIcons:
m_settings->setIcons(!m_settings->icons());
break;
diff --git a/kicker/applets/minipager/pagerapplet.h b/kicker/applets/minipager/pagerapplet.h
index ceb5ec8f4..6433a6790 100644
--- a/kicker/applets/minipager/pagerapplet.h
+++ b/kicker/applets/minipager/pagerapplet.h
@@ -64,7 +64,7 @@ public:
void setActive( WId active ) { m_activeWindow = active; }
WId activeWindow() { return m_activeWindow; }
- enum ConfigOptions { LaunchExtPager = 96, WindowThumbnails, Cycle,
+ enum ConfigOptions { LaunchExtPager = 96, WindowThumbnails, Cycle, Border3D,
WindowIcons, ConfigureDesktops, RenameDesktop };
int labelType() const { return m_settings->labelType(); }
@@ -73,6 +73,7 @@ public:
bool desktopPreview() const { return m_settings->preview(); }
bool cycleWindow() const { return m_settings->cycle(); }
bool windowIcons() const { return m_settings->icons(); }
+ bool border3D() const { return m_settings->border3D(); }
Orientation orientation() const { return KPanelApplet::orientation(); }
diff --git a/kicker/applets/minipager/pagerbutton.cpp b/kicker/applets/minipager/pagerbutton.cpp
index 22f59956d..b2a4a34a6 100644
--- a/kicker/applets/minipager/pagerbutton.cpp
+++ b/kicker/applets/minipager/pagerbutton.cpp
@@ -29,6 +29,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <tqpainter.h>
#include <tqpopupmenu.h>
#include <tqstylesheet.h>
+#include <tqinputdialog.h>
#include <netwm.h>
#include <dcopclient.h>
@@ -397,47 +398,39 @@ void KMiniPagerButton::drawButton(TQPainter *bp)
}
}
- if (!liveBkgnd)
+ // frame
+ if (liveBkgnd || transparent)
{
- if (transparent)
+ if (m_pager->border3D())
{
- // transparent windows get an 1 pixel frame...
- if (on)
- {
- bp->setPen(colorGroup().midlight());
- }
- else if (down)
- {
- bp->setPen(KickerLib::blendColors(colorGroup().mid(),
- colorGroup().midlight()));
- }
- else
- {
- bp->setPen(colorGroup().dark());
- }
-
- bp->drawRect(0, 0, w, h);
+ qDrawShadeRect(bp, 0, 0, w, h, on ? palette().active() : palette().inactive());
}
else
{
- TQBrush background;
-
- if (on)
- {
- background = colorGroup().brush(TQColorGroup::Midlight);
- }
- else if (down)
- {
- background = TQBrush(KickerLib::blendColors(colorGroup().mid(),
- colorGroup().midlight()));
- }
- else
- {
- background = colorGroup().brush(TQColorGroup::Mid);
- }
+ bp->setPen(on ? colorGroup().midlight()
+ : KickerLib::blendColors(colorGroup().mid(), colorGroup().midlight()));
+ bp->drawRect(0, 0, w, h);
+ }
+ }
+ else
+ {
+ TQBrush background;
- bp->fillRect(0, 0, w, h, background);
+ if (on)
+ {
+ background = colorGroup().brush(TQColorGroup::Midlight);
+ }
+ else if (down)
+ {
+ background = TQBrush(KickerLib::blendColors(colorGroup().mid(),
+ colorGroup().midlight()));
}
+ else
+ {
+ background = colorGroup().brush(TQColorGroup::Mid);
+ }
+
+ bp->fillRect(0, 0, w, h, background);
}
// window preview...
@@ -492,22 +485,6 @@ void KMiniPagerButton::drawButton(TQPainter *bp)
}
}
- if (liveBkgnd)
- {
- // draw a little border around the individual buttons
- // makes it look a bit more finished.
- if (on)
- {
- bp->setPen(colorGroup().midlight());
- }
- else
- {
- bp->setPen(colorGroup().mid());
- }
-
- bp->drawRect(0, 0, w, h);
- }
-
if (m_pager->labelType() != PagerSettings::EnumLabelType::LabelNone)
{
TQString label = (m_pager->labelType() == PagerSettings::EnumLabelType::LabelNumber) ?
@@ -724,17 +701,30 @@ void KMiniPagerButton::slotClicked()
void KMiniPagerButton::rename()
{
- if ( !m_lineEdit ) {
- m_lineEdit = new TQLineEdit( this );
- connect( m_lineEdit, TQ_SIGNAL( returnPressed() ), m_lineEdit, TQ_SLOT( hide() ) );
- m_lineEdit->installEventFilter( this );
- }
- m_lineEdit->setGeometry( rect() );
- m_lineEdit->setText(m_desktopName);
- m_lineEdit->show();
- m_lineEdit->setFocus();
- m_lineEdit->selectAll();
- m_pager->emitRequestFocus();
+ if (m_pager->labelType() == PagerSettings::EnumLabelType::LabelName)
+ {
+ if ( !m_lineEdit ) {
+ m_lineEdit = new TQLineEdit(this);
+ connect(m_lineEdit, TQ_SIGNAL(returnPressed()), m_lineEdit, TQ_SLOT(hide()));
+ m_lineEdit->installEventFilter(this);
+ }
+ m_lineEdit->setGeometry(rect());
+ m_lineEdit->setText(m_desktopName);
+ m_lineEdit->show();
+ m_lineEdit->setFocus();
+ m_lineEdit->selectAll();
+ m_pager->emitRequestFocus();
+ }
+ else
+ {
+ m_pager->twin()->setDesktopName(
+ m_desktop,
+ TQInputDialog::getText(
+ i18n("Renaming desktop %1").arg(m_desktopName),
+ i18n("Enter a new name for desktop %1 (%2):").arg(m_desktop).arg(m_desktopName)
+ )
+ );
+ }
}
void KMiniPagerButton::slotToggled( bool b )
diff --git a/kicker/applets/minipager/pagersettings.kcfg b/kicker/applets/minipager/pagersettings.kcfg
index 3a821f20a..11b6aa09d 100644
--- a/kicker/applets/minipager/pagersettings.kcfg
+++ b/kicker/applets/minipager/pagersettings.kcfg
@@ -49,15 +49,20 @@
<label>Show desktop preview?</label>
<default>true</default>
</entry>
-
+
<entry name="Icons" type="Bool">
<label>Show window icons in previews?</label>
<default>true</default>
</entry>
-
+
<entry name="Cycle" type="Bool">
<label>Cycle through desktops with wheel?</label>
<default>true</default>
</entry>
+
+ <entry name="Border3D" type="Bool">
+ <label>3D Desk border</label>
+ <default>false</default>
+ </entry>
</group>
</kcfg>