From 5e3bd8b2c89b2e15de6d63c70fe3f8d98cf2568d Mon Sep 17 00:00:00 2001 From: Luciano Montanaro Date: Mon, 21 Jun 2004 13:13:48 +0000 Subject: [PATCH] I'll take Lubos' answer as an "OK". So, I'll add what will probably be the least useful feature of KDE3.3: The support for a "resize" button in the titlebar. Perhaps the accessibility people could find a use for this, though. svn path=/trunk/kdebase/kwin/; revision=322458 --- kcmkwin/kwindecoration/buttons.cpp | 15 ++++++++++- kcmkwin/kwindecoration/pixmaps.h | 40 ++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 1 deletion(-) diff --git a/kcmkwin/kwindecoration/buttons.cpp b/kcmkwin/kwindecoration/buttons.cpp index a362d912c3..5ab9b23ad2 100644 --- a/kcmkwin/kwindecoration/buttons.cpp +++ b/kcmkwin/kwindecoration/buttons.cpp @@ -38,7 +38,9 @@ //=============================================================== enum Buttons{ BtnMenu=0, BtnOnAllDesktops, BtnSpacer, BtnHelp, - BtnMinimize, BtnMaximize, BtnClose, BtnAboveOthers, BtnBelowOthers, BtnShade, BtnCount }; + BtnMinimize, BtnMaximize, BtnClose, + BtnAboveOthers, BtnBelowOthers, + BtnShade, BtnResize, BtnCount }; QListBoxPixmap* buttons[ BtnCount ]; QPixmap* pixmaps[ BtnCount ]; QPixmap* miniSpacer; @@ -114,6 +116,9 @@ static int btnIndex( char btn ) case 'L': return BtnShade; break; + case 'R': + return BtnResize; + break; default: return -1; // Not found... } @@ -149,6 +154,7 @@ ButtonSource::ButtonSource( QWidget* parent, const char* name ) pixmaps[ BtnAboveOthers ] = new QPixmap( button_above_others_xpm ); pixmaps[ BtnBelowOthers ] = new QPixmap( button_below_others_xpm ); pixmaps[ BtnShade ] = new QPixmap( button_shade_xpm ); + pixmaps[ BtnResize ] = new QPixmap( button_resize_xpm ); miniSpacer = new QPixmap( titlebarspacer_xpm ); // Add all possible button/spacer types to the list box. @@ -157,6 +163,7 @@ ButtonSource::ButtonSource( QWidget* parent, const char* name ) buttons[ BtnAboveOthers ] = new QListBoxPixmap( this, *pixmaps[BtnAboveOthers], i18n("Keep Above Others") ); buttons[ BtnBelowOthers ] = new QListBoxPixmap( this, *pixmaps[BtnBelowOthers], i18n("Keep Below Others") ); buttons[ BtnShade ] = new QListBoxPixmap( this, *pixmaps[BtnShade], i18n("Shade") ); + buttons[ BtnResize ] = new QListBoxPixmap( this, *pixmaps[BtnResize], i18n("Resize") ); buttons[ BtnSpacer ] = new QListBoxPixmap( this, *pixmaps[BtnSpacer], i18n("Spacer") ); buttons[ BtnHelp ] = new QListBoxPixmap( this, *pixmaps[BtnHelp], i18n("Help") ); buttons[ BtnMinimize ] = new QListBoxPixmap( this, *pixmaps[BtnMinimize], i18n("Minimize") ); @@ -190,6 +197,8 @@ void ButtonSource::hideAllButtons() takeItem( buttons[BtnAboveOthers] ); if (index( buttons[BtnBelowOthers] )!= -1) takeItem( buttons[BtnBelowOthers] ); + if (index( buttons[BtnResize] )!= -1) + takeItem( buttons[BtnResize] ); if (index( buttons[BtnShade] )!= -1) takeItem( buttons[BtnShade] ); if (index( buttons[BtnHelp] ) != -1) @@ -217,6 +226,8 @@ void ButtonSource::showAllButtons() insertItem( buttons[BtnAboveOthers] ); if (index( buttons[BtnBelowOthers] )== -1) insertItem( buttons[BtnBelowOthers] ); + if (index( buttons[BtnResize] )== -1) + insertItem( buttons[BtnResize] ); if (index( buttons[BtnShade] )== -1) insertItem( buttons[BtnShade] ); if (index( buttons[BtnHelp] ) == -1) @@ -301,6 +312,8 @@ char ButtonSource::convertToChar( QString s ) return 'B'; else if (s == i18n("Shade")) return 'L'; + else if (s == i18n("Resize")) + return 'R'; else return '?'; } diff --git a/kcmkwin/kwindecoration/pixmaps.h b/kcmkwin/kwindecoration/pixmaps.h index 5589e8ba37..271893b48b 100644 --- a/kcmkwin/kwindecoration/pixmaps.h +++ b/kcmkwin/kwindecoration/pixmaps.h @@ -469,4 +469,44 @@ const char * button_shade_xpm[] = { "))))))))))))))))))))", "))))))))))))))))))))"}; +/* XPM */ +const char * button_resize_xpm[] = { +"20 20 16 1", +" c None", +". c #F3F3F3", +"+ c #F2F2F2", +"@ c #F1F1F1", +"# c #FFFFFF", +"$ c #F0F0F0", +"% c #6E6E6E", +"& c #EFEFEF", +"* c #EEEEEE", +"= c #EDEDED", +"- c #ECECEC", +"; c #EBEBEB", +"> c #EAEAEA", +", c #E9E9E9", +"' c #E8E8E8", +") c #E7E7E7", +"....................", +"....................", +"++++++++++++++++++++", +"@@@@@@@@@@@@@@@@@@@@", +"@@@@###########@@@@@", +"$$$$#%%%%%%%%%%$$$$$", +"&&&&#%...#%..#%&&&&&", +"&&&&#%...#%..#%&&&&&", +"****#%...#%..#%*****", +"====#%####%..#%=====", +"====#%%%%%%..#%=====", +"----#%.......#%-----", +";;;;#%.......#%;;;;;", +";;;;#%########%;;;;;", +">>>>#%%%%%%%%%%>>>>>", +",,,,,,,,,,,,,,,,,,,,", +",,,,,,,,,,,,,,,,,,,,", +"''''''''''''''''''''", +"))))))))))))))))))))", +"))))))))))))))))))))"}; + // vim: ts=4