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>
pull/576/head
Mavridis Philippe 12 months ago committed by Philippe Mavridis
parent 5570cf74bb
commit fa284a4598
No known key found for this signature in database
GPG Key ID: BB7EB07B27B3C64B

@ -61,9 +61,9 @@ advancedDialog::advancedDialog(TQWidget* parent, const char* name)
this, TQ_SLOT(changed()));
connect(m_advancedWidget->tintSlider, TQ_SIGNAL(valueChanged(int)),
this, TQ_SLOT(changed()));
connect(m_advancedWidget->menubarPanelTransparent, TQ_SIGNAL(clicked()),
connect(m_advancedWidget->blurSlider, TQ_SIGNAL(valueChanged(int)),
this, TQ_SLOT(changed()));
connect(m_advancedWidget->menubarPanelBlurred, TQ_SIGNAL(clicked()),
connect(m_advancedWidget->menubarPanelTransparent, TQ_SIGNAL(clicked()),
this, TQ_SLOT(changed()));
connect(m_advancedWidget->kickerResizeHandle, TQ_SIGNAL(clicked()),
this, TQ_SLOT(changed()));
@ -97,10 +97,21 @@ void advancedDialog::load()
int tintValue = c.readNumEntry( "TintValue", 33 );
m_advancedWidget->tintSlider->setValue( tintValue );
// Compatibility with deprecated MenubarPanelBlurred option
int blurValue = 0;
if (c.hasKey("MenubarPanelBlurred"))
{
if (c.readNumEntry("MenubarPanelBlurred", false))
{
blurValue = 4;
}
c.deleteEntry("MenubarPanelBlurred");
}
blurValue = c.readNumEntry("BlurValue", blurValue);
m_advancedWidget->blurSlider->setValue(blurValue);
bool transparentMenubarPanel = c.readBoolEntry("MenubarPanelTransparent", false);
m_advancedWidget->menubarPanelTransparent->setChecked( transparentMenubarPanel );
bool blurredMenubarPanel = c.readBoolEntry("MenubarPanelBlurred", false);
m_advancedWidget->menubarPanelBlurred->setChecked( blurredMenubarPanel );
bool useKickerResizeHandle = c.readBoolEntry("UseResizeHandle", false);
m_advancedWidget->kickerResizeHandle->setChecked( useKickerResizeHandle );
@ -125,10 +136,10 @@ void advancedDialog::save()
m_advancedWidget->tintColorB->color());
c.writeEntry("TintValue",
m_advancedWidget->tintSlider->value());
c.writeEntry("BlurValue",
m_advancedWidget->blurSlider->value());
c.writeEntry("MenubarPanelTransparent",
m_advancedWidget->menubarPanelTransparent->isChecked());
c.writeEntry("MenubarPanelBlurred",
m_advancedWidget->menubarPanelBlurred->isChecked());
c.writeEntry("UseResizeHandle",
m_advancedWidget->kickerResizeHandle->isChecked());
c.writeEntry("ShowDeepButtons",
@ -161,10 +172,10 @@ void advancedDialog::save()
m_advancedWidget->tintColorB->color());
extConfig.writeEntry("TintValue",
m_advancedWidget->tintSlider->value());
extConfig.writeEntry("BlurValue",
m_advancedWidget->blurSlider->value());
extConfig.writeEntry("MenubarPanelTransparent",
m_advancedWidget->menubarPanelTransparent->isChecked());
extConfig.writeEntry("MenubarPanelBlurred",
m_advancedWidget->menubarPanelBlurred->isChecked());
extConfig.writeEntry("UseResizeHandle",
m_advancedWidget->kickerResizeHandle->isChecked());
extConfig.writeEntry("ShowDeepButtons",
@ -172,7 +183,7 @@ void advancedDialog::save()
extConfig.sync();
}
c.sync();
KickerConfig::the()->notifyKicker();

@ -8,21 +8,30 @@
<rect>
<x>0</x>
<y>0</y>
<width>324</width>
<height>235</height>
<width>425</width>
<height>360</height>
</rect>
</property>
<property name="caption">
<string>advancedKickerOptions</string>
</property>
<vbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<property name="margin">
<number>0</number>
<number>5</number>
</property>
<widget class="TQGroupBox">
<property name="name">
<cstring>groupBox3</cstring>
</property>
<property name="frameShape">
<enum>StyledPanel</enum>
</property>
<property name="margin">
<number>2</number>
</property>
<property name="title">
<string>Panel Dimensions</string>
</property>
@ -84,6 +93,12 @@
<property name="name">
<cstring>handles</cstring>
</property>
<property name="frameShape">
<enum>StyledPanel</enum>
</property>
<property name="margin">
<number>2</number>
</property>
<property name="title">
<string>Applet Handles</string>
</property>
@ -158,6 +173,20 @@
<property name="name">
<cstring>groupBox2</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>5</hsizetype>
<vsizetype>4</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="frameShape">
<enum>StyledPanel</enum>
</property>
<property name="margin">
<number>2</number>
</property>
<property name="title">
<string>Transparency</string>
</property>
@ -165,77 +194,179 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="KColorButton" row="0" column="1">
<widget class="TQLabel" row="2" column="0">
<property name="name">
<cstring>tintColorB</cstring>
<cstring>textLabel1_2</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>7</hsizetype>
<vsizetype>0</vsizetype>
<hsizetype>4</hsizetype>
<vsizetype>5</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string></string>
<string>Ti&amp;nt amount:</string>
</property>
<property name="buddy" stdset="0">
<cstring>tintSlider</cstring>
</property>
<property name="whatsThis" stdset="0">
<string>Click on this button to set the color to use when tinting transparent panels.</string>
<string>Use this slider to set how much transparent panels should be tinted using the tint color.</string>
</property>
</widget>
<widget class="TQLabel" row="4" column="3">
<property name="name">
<cstring>textLabel2</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>5</hsizetype>
<vsizetype>4</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Max</string>
</property>
<property name="alignment">
<set>AlignVCenter|AlignRight</set>
</property>
<property name="whatsThis" stdset="0">
<string>Use this slider to set how much transparent panels should be tinted using the tint color.</string>
</property>
</widget>
<widget class="TQLabel" row="6" column="3">
<property name="name">
<cstring>textLabel2_2</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>5</hsizetype>
<vsizetype>4</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Max blur</string>
</property>
<property name="alignment">
<set>AlignVCenter|AlignRight</set>
</property>
<property name="whatsThis" stdset="0">
<string>Use this slider to set how much transparent panels should be blurred.</string>
</property>
</widget>
<spacer row="2" column="0">
<spacer row="7" column="2">
<property name="name">
<cstring>spacer2</cstring>
<cstring>spacer2_2_2</cstring>
</property>
<property name="orientation">
<enum>Vertical</enum>
</property>
<property name="sizeType">
<enum>Expanding</enum>
<enum>Maximum</enum>
</property>
<property name="sizeHint">
<size>
<width>20</width>
<height>21</height>
<height>16</height>
</size>
</property>
</spacer>
<widget class="TQLabel" row="2" column="1">
<widget class="TQLabel" row="5" column="0">
<property name="name">
<cstring>textLabel3</cstring>
<cstring>textLabel1_2_2</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>4</hsizetype>
<vsizetype>5</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Min</string>
<string>&amp;Blur amount:</string>
</property>
<property name="alignment">
<set>AlignVCenter|AlignLeft</set>
<property name="buddy" stdset="0">
<cstring>blurSlider</cstring>
</property>
<property name="whatsThis" stdset="0">
<string>Use this slider to set how much transparent panels should be tinted using the tint color.</string>
<string>Use this slider to set how much transparent panels should be blurred.</string>
</property>
</widget>
<spacer row="0" column="2">
<widget class="TQLabel" row="0" column="0">
<property name="name">
<cstring>textLabel1</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>4</hsizetype>
<vsizetype>5</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Tint c&amp;olor:</string>
</property>
<property name="buddy" stdset="0">
<cstring>tintColorB</cstring>
</property>
<property name="whatsThis" stdset="0">
<string>Click on this button to set the color to use when tinting transparent panels.</string>
</property>
</widget>
<spacer row="6" column="0">
<property name="name">
<cstring>spacer3</cstring>
<cstring>spacer2_2</cstring>
</property>
<property name="orientation">
<enum>Horizontal</enum>
<enum>Vertical</enum>
</property>
<property name="sizeType">
<enum>Expanding</enum>
<enum>Maximum</enum>
</property>
<property name="sizeHint">
<size>
<width>81</width>
<width>20</width>
<height>16</height>
</size>
</property>
</spacer>
<spacer row="4" column="0">
<property name="name">
<cstring>spacer2_2_2_2</cstring>
</property>
<property name="orientation">
<enum>Vertical</enum>
</property>
<property name="sizeType">
<enum>MinimumExpanding</enum>
</property>
<property name="sizeHint">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
<widget class="TQSlider" row="1" column="1" rowspan="1" colspan="2">
<widget class="TQSlider" row="2" column="1" rowspan="2" colspan="3">
<property name="name">
<cstring>tintSlider</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>7</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="orientation">
<enum>Horizontal</enum>
</property>
@ -243,49 +374,87 @@
<string>Use this slider to set how much transparent panels should be tinted using the tint color.</string>
</property>
</widget>
<widget class="TQLabel" row="2" column="2">
<widget class="KColorButton" row="0" column="1">
<property name="name">
<cstring>textLabel2</cstring>
<cstring>tintColorB</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>4</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Max</string>
<string></string>
</property>
<property name="whatsThis" stdset="0">
<string>Click on this button to set the color to use when tinting transparent panels.</string>
</property>
</widget>
<widget class="TQLabel" row="4" column="1" rowspan="1" colspan="2">
<property name="name">
<cstring>textLabel3</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>5</hsizetype>
<vsizetype>4</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Min</string>
</property>
<property name="alignment">
<set>AlignVCenter|AlignRight</set>
<set>AlignVCenter|AlignLeft</set>
</property>
<property name="whatsThis" stdset="0">
<string>Use this slider to set how much transparent panels should be tinted using the tint color.</string>
</property>
</widget>
<widget class="TQLabel" row="1" column="0">
<widget class="TQSlider" row="5" column="1" rowspan="1" colspan="3">
<property name="name">
<cstring>textLabel1_2</cstring>
<cstring>blurSlider</cstring>
</property>
<property name="text">
<string>Ti&amp;nt amount:</string>
<property name="minValue">
<number>0</number>
</property>
<property name="buddy" stdset="0">
<cstring>tintSlider</cstring>
<property name="maxValue">
<number>10</number>
</property>
<property name="orientation">
<enum>Horizontal</enum>
</property>
<property name="whatsThis" stdset="0">
<string>Use this slider to set how much transparent panels should be tinted using the tint color.</string>
<string>Use this slider to set how much transparent panels should be blurred.</string>
</property>
</widget>
<widget class="TQLabel" row="0" column="0">
<widget class="TQLabel" row="6" column="1">
<property name="name">
<cstring>textLabel1</cstring>
<cstring>textLabel3_2</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>5</hsizetype>
<vsizetype>4</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Tint c&amp;olor:</string>
<string>No blur</string>
</property>
<property name="buddy" stdset="0">
<cstring>tintColorB</cstring>
<property name="alignment">
<set>AlignVCenter|AlignLeft</set>
</property>
<property name="whatsThis" stdset="0">
<string>Click on this button to set the color to use when tinting transparent panels.</string>
<string>Use this slider to set how much transparent panels should be blurred.</string>
</property>
</widget>
<widget class="TQCheckBox" row="3" column="0" rowspan="1" colspan="2">
<widget class="TQCheckBox" row="8" column="0" rowspan="1" colspan="4">
<property name="name">
<cstring>menubarPanelTransparent</cstring>
</property>
@ -296,54 +465,49 @@
<string>Normally if you have the desktop's or current application's menu bar displayed in a panel at the top of the screen (MacOS-style), transparency is disabled for this panel to avoid the desktop background clashing with the menu bar. Set this option to make it transparent anyways.</string>
</property>
</widget>
<widget class="TQCheckBox" row="4" column="0" rowspan="1" colspan="2">
</grid>
</widget>
<widget class="TQGroupBox">
<property name="name">
<cstring>groupBox3</cstring>
</property>
<property name="frameShape">
<enum>StyledPanel</enum>
</property>
<property name="margin">
<number>2</number>
</property>
<property name="title">
<string>Texture</string>
</property>
<grid>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="TQCheckBox" row="0" column="0">
<property name="name">
<cstring>menubarPanelBlurred</cstring>
<cstring>kickerResizeHandle</cstring>
</property>
<property name="text">
<string>Blur the background when transparency is enabled</string>
<string>Show resize handle on panels</string>
</property>
<property name="whatsThis" stdset="0">
<string>When checked, the displayed semi-transparent background image will be blurred to reduce eyestrain.</string>
<string>Enabling this option will show a resize handle on the resizable end of each panel.</string>
</property>
</widget>
<widget class="TQCheckBox" row="0" column="1">
<property name="name">
<cstring>kickerDeepButtons</cstring>
</property>
<property name="text">
<string>Use deep buttons</string>
</property>
<property name="whatsThis" stdset="0">
<string>Enabling this option will yield more highly textured panels.</string>
</property>
</widget>
</grid>
</widget>
<widget class="TQGroupBox">
<property name="name">
<cstring>groupBox3</cstring>
</property>
<property name="title">
<string>Texture</string>
</property>
<grid>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="TQCheckBox" row="0" column="0" rowspan="0" colspan="2">
<property name="name">
<cstring>kickerResizeHandle</cstring>
</property>
<property name="text">
<string>Show resize handle on panels</string>
</property>
<property name="whatsThis" stdset="0">
<string>Enabling this option will show a resize handle on the resizable end of each panel.</string>
</property>
</widget>
<widget class="TQCheckBox" row="0" column="2" rowspan="0" colspan="2">
<property name="name">
<cstring>kickerDeepButtons</cstring>
</property>
<property name="text">
<string>Use deep buttons</string>
</property>
<property name="whatsThis" stdset="0">
<string>Enabling this option will yield more highly textured panels.</string>
</property>
</widget>
</grid>
</widget>
</vbox>
</widget>
<tabstops>
@ -358,6 +522,7 @@
<include location="global" impldecl="in implementation">kdialog.h</include>
<include location="global" impldecl="in implementation">kcolorbutton.h</include>
<include location="global" impldecl="in declaration">knuminput.h</include>
<include location="global" impldecl="in implementation">knuminput.h</include>
</includes>
<layoutdefaults spacing="3" margin="6"/>
<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>

@ -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;

@ -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(); }

@ -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 )

@ -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>

@ -28,6 +28,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <tqcursor.h>
#include <tqpopupmenu.h>
#include <tqspinbox.h>
#include <tqcheckbox.h>
#include <tqtimer.h>
#include <tqpixmap.h>
#include <tqevent.h>
@ -35,6 +37,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <tqgrid.h>
#include <tqpainter.h>
#include <tqimage.h>
#include <tqlayout.h>
#include <dcopclient.h>
#include <tdeapplication.h>
@ -58,7 +61,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <X11/Xlib.h>
#define ICON_MARGIN 1
#define ICON_END_MARGIN KickerSettings::showDeepButtons()?4:0
extern "C"
@ -74,20 +76,22 @@ extern "C"
SystemTrayApplet::SystemTrayApplet(const TQString& configFile, Type type, int actions,
TQWidget *parent, const char *name)
: KPanelApplet(configFile, type, actions, parent, name),
m_showFrame(KickerSettings::showDeepButtons()?true:false),
m_showFrame(KickerSettings::showDeepButtons()),
m_showHidden(false),
m_expandButton(0),
m_leftSpacer(0),
m_rightSpacer(0),
m_clockApplet(0),
m_settingsDialog(0),
m_expandButton(nullptr),
m_leftSpacer(nullptr),
m_rightSpacer(nullptr),
m_clockApplet(nullptr),
m_settingsDialog(nullptr),
m_iconSelector(0),
m_autoRetractTimer(0),
m_autoRetractTimer(nullptr),
m_autoRetract(false),
m_iconSize(24),
m_showClockInTray(false),
m_showClockSettingCB(0),
m_layout(0)
m_showClockSettingCB(nullptr),
m_iconMargin(1),
m_iconMarginSB(nullptr),
m_layout(nullptr)
{
DCOPObject::setObjId("SystemTrayApplet");
loadSettings();
@ -119,14 +123,14 @@ void SystemTrayApplet::updateClockGeometry()
if (m_clockApplet)
{
m_clockApplet->setPosition(position());
if (orientation() == TQt::Horizontal)
{
m_clockApplet->setFixedSize(m_clockApplet->widthForHeight(height()),height());
}
else
{
m_clockApplet->setFixedSize(width(),m_clockApplet->heightForWidth(width()));
}
if (orientation() == TQt::Horizontal)
{
m_clockApplet->setFixedSize(m_clockApplet->widthForHeight(height()),height());
}
else
{
m_clockApplet->setFixedSize(width(),m_clockApplet->heightForWidth(width()));
}
}
}
@ -190,7 +194,7 @@ void SystemTrayApplet::initialize()
XSendEvent (display, root, False, StructureNotifyMask, (XEvent *)&xev);
}
setBackground();
}
@ -253,7 +257,7 @@ void SystemTrayApplet::preferences()
connect(m_settingsDialog, TQ_SIGNAL(okClicked()), this, TQ_SLOT(applySettings()));
connect(m_settingsDialog, TQ_SIGNAL(finished()), this, TQ_SLOT(settingsDialogFinished()));
TQGrid *settingsGrid = m_settingsDialog->makeGridMainWidget( 2, TQt::Vertical);
TQGrid *settingsGrid = m_settingsDialog->makeGridMainWidget( 3, TQt::Vertical);
m_showClockSettingCB = new TQCheckBox(i18n("Show Clock in Tray"), settingsGrid);
m_showClockSettingCB->setChecked(m_showClockInTray);
@ -289,6 +293,13 @@ void SystemTrayApplet::preferences()
}
}
TQHBox *hbox = new TQHBox(settingsGrid);
hbox->setSizePolicy(TQSizePolicy::Maximum, TQSizePolicy::Maximum);
TQLabel *iconMarginL = new TQLabel(i18n("Icon margin: "), hbox);
m_iconMarginSB = new TQSpinBox(0, 20, 1, hbox);
m_iconMarginSB->setSuffix(i18n(" px"));
m_iconMarginSB->setValue(m_iconMargin);
m_settingsDialog->show();
}
@ -307,6 +318,7 @@ void SystemTrayApplet::applySettings()
}
m_showClockInTray = m_showClockSettingCB->isChecked();
m_iconMargin = m_iconMarginSB->value();
TDEConfig *conf = config();
@ -356,6 +368,7 @@ void SystemTrayApplet::applySettings()
conf->setGroup("System Tray");
conf->writeEntry("ShowClockInTray", m_showClockInTray);
conf->writeEntry("IconMargin", m_iconMargin);
conf->sync();
@ -483,7 +496,7 @@ void SystemTrayApplet::iconSizeChanged() {
(*emb)->setFixedSize(m_iconSize, m_iconSize);
++emb;
}
emb = m_hiddenWins.begin();
while (emb != m_hiddenWins.end()) {
(*emb)->setFixedSize(m_iconSize, m_iconSize);
@ -516,6 +529,7 @@ void SystemTrayApplet::loadSettings()
conf->setGroup("System Tray");
m_iconSize = conf->readNumEntry("systrayIconWidth", 22);
m_showClockInTray = conf->readNumEntry("ShowClockInTray", false);
m_iconMargin = conf->readNumEntry("IconMargin", 1);
}
void SystemTrayApplet::systemTrayWindowAdded( WId w )
@ -627,7 +641,7 @@ void SystemTrayApplet::updateVisibleWins()
(*emb)->hide();
}
}
TQMap< QXEmbed*, TQString > names; // cache window names and classes
TQMap< QXEmbed*, TQString > classes;
for( TrayEmbedList::const_iterator it = m_shownWins.begin();
@ -683,7 +697,7 @@ void SystemTrayApplet::refreshExpandButton()
a = m_showHidden ? TQt::DownArrow : TQt::UpArrow;
else
a = (m_showHidden ^ tdeApp->reverseLayout()) ? TQt::RightArrow : TQt::LeftArrow;
m_expandButton->setArrowType(a);
}
@ -881,7 +895,7 @@ int SystemTrayApplet::widthForHeight(int h) const
me->setFixedHeight(h);
}
return sizeHint().width();
return sizeHint().width();
}
int SystemTrayApplet::heightForWidth(int w) const
@ -900,7 +914,7 @@ int SystemTrayApplet::heightForWidth(int w) const
me->setFixedWidth(w);
}
return sizeHint().height();
return sizeHint().height();
}
void SystemTrayApplet::moveEvent( TQMoveEvent* )
@ -933,7 +947,7 @@ void SystemTrayApplet::layoutTray()
int i = 0, line, nbrOfLines, heightWidth;
bool showExpandButton = m_expandButton && m_expandButton->isVisibleTo(this);
delete m_layout;
m_layout = new TQGridLayout(this, 1, 1, ICON_MARGIN, ICON_MARGIN);
m_layout = new TQGridLayout(this, 1, 1, 0, m_iconMargin);
if (m_expandButton)
{
@ -951,20 +965,20 @@ void SystemTrayApplet::layoutTray()
// the opposite direction of line
int col = 0;
//
//
// The margin and spacing specified in the layout implies that:
// [-- ICON_MARGIN pixels --] [-- first icon --] [-- ICON_MARGIN pixels --] ... [-- ICON_MARGIN pixels --] [-- last icon --] [-- ICON_MARGIN pixels --]
// [-- m_iconMargin pixels --] [-- first icon --] [-- m_iconMargin pixels --] ... [-- m_iconMargin pixels --] [-- last icon --] [-- m_iconMargin pixels --]
//
// So, if we say that iconWidth is the icon width plus the ICON_MARGIN pixels spacing, then the available width for the icons
// is the widget width minus ICON_MARGIN pixels margin. Forgetting these ICON_MARGIN pixels broke the layout algorithm in KDE <= 3.5.9.
// So, if we say that iconWidth is the icon width plus the m_iconMargin pixels spacing, then the available width for the icons
// is the widget width minus m_iconMargin pixels margin. Forgetting these m_iconMargin pixels broke the layout algorithm in KDE <= 3.5.9.
//
// This fix makes the workarounds in the heightForWidth() and widthForHeight() methods unneeded.
//
if (orientation() == TQt::Vertical)
{
int iconWidth = maxIconWidth() + ICON_MARGIN; // +2 for the margins that implied by the layout
heightWidth = width() - ICON_MARGIN;
int iconWidth = maxIconWidth() + m_iconMargin * 2; // +2 for the margins that implied by the layout
heightWidth = width() - m_iconMargin * 2;
// to avoid nbrOfLines=0 we ensure heightWidth >= iconWidth!
heightWidth = heightWidth < iconWidth ? iconWidth : heightWidth;
nbrOfLines = heightWidth / iconWidth;
@ -1040,8 +1054,8 @@ void SystemTrayApplet::layoutTray()
}
else // horizontal
{
int iconHeight = maxIconHeight() + ICON_MARGIN; // +2 for the margins that implied by the layout
heightWidth = height() - ICON_MARGIN;
int iconHeight = maxIconHeight() + m_iconMargin * 2; // +2 for the margins that implied by the layout
heightWidth = height() - m_iconMargin * 2;
heightWidth = heightWidth < iconHeight ? iconHeight : heightWidth; // to avoid nbrOfLines=0
nbrOfLines = heightWidth / iconHeight;
@ -1129,11 +1143,11 @@ void SystemTrayApplet::paletteChange(const TQPalette & /* oldPalette */)
void SystemTrayApplet::setBackground()
{
TrayEmbedList::const_iterator lastEmb;
lastEmb = m_shownWins.end();
for (TrayEmbedList::const_iterator emb = m_shownWins.begin(); emb != lastEmb; ++emb)
(*emb)->setBackground();
lastEmb = m_hiddenWins.end();
for (TrayEmbedList::const_iterator emb = m_hiddenWins.begin(); emb != lastEmb; ++emb)
(*emb)->setBackground();
@ -1188,7 +1202,7 @@ void TrayEmbed::ensureBackgroundSet()
// Get the RGB background image
bg.fill(parentWidget(), pos());
TQImage bgImage = bg.convertToImage();
// Create the ARGB pixmap
Pixmap argbpixmap = XCreatePixmap(x11Display(), embeddedWinId(), width(), height(), 32);
GC gc;
@ -1207,7 +1221,7 @@ void TrayEmbed::ensureBackgroundSet()
XDrawPoint(x11Display(), argbpixmap, gc, x, y);
}
}
XFlush(x11Display());
XFlush(x11Display());
XSetWindowBackgroundPixmap(x11Display(), embeddedWinId(), argbpixmap);
XFreePixmap(x11Display(), argbpixmap);
XFreeGC(x11Display(), gc);

@ -27,8 +27,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <tqvaluevector.h>
#include <tqstringlist.h>
#include <tqevent.h>
#include <tqlayout.h>
#include <tqcheckbox.h>
#include <qxembed.h>
#include <dcopobject.h>
@ -40,6 +38,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "simplebutton.h"
class TQGridLayout;
class TQSpinBox;
class TQCheckBox;
class TQTimer;
class KWinModule;
class TrayEmbed;
@ -120,6 +120,8 @@ private:
int m_iconSize;
bool m_showClockInTray;
TQCheckBox *m_showClockSettingCB;
uint m_iconMargin;
TQSpinBox *m_iconMarginSB;
TQGridLayout* m_layout;
};

@ -1446,12 +1446,7 @@ void ContainerArea::setBackground()
double tint = double(KickerSettings::tintValue()) / 100;
_rootPixmap->setFadeEffect(tint, KickerSettings::tintColor());
if (KickerSettings::menubarPanelBlurred()) {
_rootPixmap->setBlurEffect(0.0, 4.0);
}
else {
_rootPixmap->setBlurEffect(0.0, 0.0);
}
_rootPixmap->setBlurEffect(0.0, KickerSettings::blurValue());
_rootPixmap->start();
_bgSet = true;
return;

@ -44,8 +44,8 @@
</entry>
<entry name="MenubarPanelBlurred" type="Bool" >
<label>Enable blurring for menubar panel</label>
<whatsthis>When this option is enabled, the panel containing the menubar will blur pseudo-transparent image</whatsthis>
<label>Enable blurring for menubar panel (deprecated)</label>
<whatsthis>This option is deprecated, use MenubarPanelBlur</whatsthis>
<default>false</default>
</entry>
@ -79,6 +79,14 @@
<max>100</max>
</entry>
<entry name="BlurValue" type="Int" >
<label>Blur strength</label>
<whatsthis>Set blur effect strenght for the panel. Set to 0 to disable blur.</whatsthis>
<default>0</default>
<min>0</min>
<max>10</max>
</entry>
<entry name="TintColor" type="Color" >
<label>The tint color used to colorize transparent panels</label>
<default code="true">(TQApplication::palette().active().mid())</default>

Loading…
Cancel
Save