--nextPart3210277.vE5DQV1Ocb Content-Type: multipart/mixed; boundary="Boundary-01=_D83OHXoTp3MxUhz" Content-Transfer-Encoding: 7bit Content-Disposition: inline --Boundary-01=_D83OHXoTp3MxUhz Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline hi all ... something that i've been wanting to see happen for a while is our window=20 button order modified a bit. in particular, the defaults would be changed=20 to "maximize, minimize, sticky, spacer*2, help, menu" on the left and "clos= e"=20 on the right. the reasons for this layout are: * close is a destructive action and should therefore be kept away from othe= r=20 buttons. we do this in our menus as well. * the two most important buttons are close and either maximize or minimize= =20 depending on the user. so they should each have corner positions for easy=20 mouse access. i put maximize as the left corner item because it benefits th= e=20 most from this position between maximize and minimize: when maximized the=20 window is guaranteed to have a corner position (well, barring panels, etc i= n=20 the way) so maximize is probably the more likely action to benefit. * in our dialogs we put "go away" buttons on the right (e.g. Ok, Cancel) an= d=20 action buttons to the left (Help, Defaults, etc). we usually put our clear= =20 buttons on the right in line edits, etc ... this brings the window=20 decorations into line with this concept. attached is a patch that accomplishes this. the patch does four things: * it changes the defaults to the above * it introduces two new static methods to KDecorationOptions that return th= e=20 defaults, removing a lot of duplication in the code where the defaults were= =20 hard coded * makes the left/right buton default methods in KCommonDecoration=20 non-pure-virtual and provides an implementation that returns the defaults a= s=20 defined in KDecorationOptions. this allows window decorations to use the KD= E=20 defaults, even if they change over time. decos that have good reason for=20 different defaults can still override the methods, of course. this change i= s=20 BIC, but SC. * modifies the karmik, plastik and oxygen decos to use the new defaults. i'= ve=20 left the rest as is out of respect for their authors and provenance (e.g. i= =20 assume the redmond deco should continue to have the typical MS Windows=20 ordering) this is a small thing, but small things make life better. i believe this wo= uld=20 be worthwhile add to kde4. it was also a nice 15 minute break from plasma=20 code ;) =2D-=20 Aaron J. Seigo humru othro a kohnu se GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA EE75 D6B7 2EB1 A7F1 DB43 KDE core developer sponsored by Trolltech --Boundary-01=_D83OHXoTp3MxUhz Content-Type: text/x-diff; charset="us-ascii"; name="window_button_order.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="window_button_order.diff" Index: clients/keramik/keramik.cpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2D-- clients/keramik/keramik.cpp (revision 736818) +++ clients/keramik/keramik.cpp (working copy) @@ -61,10 +61,6 @@ const int buttonSpacing =3D 4; // Spacing between the titlebar butto= ns const int iconSpacing =3D 5; // Spacing between the icon and the t= ext label =20 =2D // Default button layout =2D const char default_left[] =3D "M"; =2D const char default_right[] =3D "HIAX"; =2D // Titlebar button bitmaps const unsigned char menu_bits[] =3D { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -929,7 +925,7 @@ =20 titleLayout->addSpacing( buttonMargin ); // Left button margin addButtons( titleLayout, options()->customButtonPositions() ? =2D options()->titleButtonsLeft() : QString(default_left) ); + options()->titleButtonsLeft() : KDecorationOptions::defaultTitleButtons= Left() ); =20 titlebar =3D new QSpacerItem( 10, clientHandler->titleBarHeight(largeTitl= ebar) - topSpacing, QSizePolicy::Expanding, QSizePolicy::Minimum ); @@ -937,7 +933,7 @@ =20 titleLayout->addSpacing( buttonSpacing ); addButtons( titleLayout, options()->customButtonPositions() ? =2D options()->titleButtonsRight() : QString(default_right) ); + options()->titleButtonsRight() : KDecorationOptions::defaultTitleButto= nsRight() ); titleLayout->addSpacing( buttonMargin - 1 ); // Right button margin =20 windowLayout->addSpacing( leftBorderWidth ); // Left border Index: clients/plastik/plastikclient.cpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2D-- clients/plastik/plastikclient.cpp (revision 736818) +++ clients/plastik/plastikclient.cpp (working copy) @@ -56,16 +56,6 @@ return i18n("Plastik"); } =20 =2DQString PlastikClient::defaultButtonsLeft() const =2D{ =2D return "M"; =2D} =2D =2DQString PlastikClient::defaultButtonsRight() const =2D{ =2D return "HIAX"; =2D} =2D bool PlastikClient::decorationBehaviour(DecorationBehaviour behaviour) con= st { switch (behaviour) { Index: clients/plastik/plastikclient.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2D-- clients/plastik/plastikclient.h (revision 736818) +++ clients/plastik/plastikclient.h (working copy) @@ -37,8 +37,6 @@ ~PlastikClient(); =20 virtual QString visibleName() const; =2D virtual QString defaultButtonsLeft() const; =2D virtual QString defaultButtonsRight() const; virtual bool decorationBehaviour(DecorationBehaviour behaviour) const; virtual int layoutMetric(LayoutMetric lm, bool respectWindowState =3D = true, const KCommonDecorationButton * =3D 0) const; virtual QRegion cornerShape(WindowCorner corner); Index: clients/oxygen/oxygenclient.cpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2D-- clients/oxygen/oxygenclient.cpp (revision 736818) +++ clients/oxygen/oxygenclient.cpp (working copy) @@ -68,16 +68,6 @@ return i18n("Oxygen"); } =20 =2DQString OxygenClient::defaultButtonsLeft() const =2D{ =2D return "M"; =2D} =2D =2DQString OxygenClient::defaultButtonsRight() const =2D{ =2D return "HIAX"; =2D} =2D void OxygenClient::init() { KCommonDecoration::init(); Index: clients/oxygen/oxygenclient.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2D-- clients/oxygen/oxygenclient.h (revision 736818) +++ clients/oxygen/oxygenclient.h (working copy) @@ -45,8 +45,6 @@ virtual ~OxygenClient(); =20 virtual QString visibleName() const; =2D virtual QString defaultButtonsLeft() const; =2D virtual QString defaultButtonsRight() const; virtual KCommonDecorationButton *createButton(::ButtonType type); virtual bool decorationBehaviour(DecorationBehaviour behaviour) const; virtual int layoutMetric(LayoutMetric lm, bool respectWindowState =3D = true, const KCommonDecorationButton * =3D 0) const; Index: kcmkwin/kwindecoration/kwindecoration.cpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2D-- kcmkwin/kwindecoration/kwindecoration.cpp (revision 736818) +++ kcmkwin/kwindecoration/kwindecoration.cpp (working copy) @@ -472,9 +472,9 @@ cbUseCustomButtonPositions->setChecked( customPositions ); buttonPositionWidget->setEnabled( customPositions ); // Menu and onAllDesktops buttons are default on LHS =2D buttonPositionWidget->setButtonsLeft( conf.readEntry("ButtonsOnLeft", "= MS") ); + buttonPositionWidget->setButtonsLeft( conf.readEntry("ButtonsOnLeft", KDe= corationOptions::defaultTitleButtonsLeft()) ); // Help, Minimize, Maximize and Close are default on RHS =2D buttonPositionWidget->setButtonsRight( conf.readEntry("ButtonsOnRight",= "HIAX") ); + buttonPositionWidget->setButtonsRight( conf.readEntry("ButtonsOnRight", K= DecorationOptions::defaultTitleButtonsRight()) ); =20 int bsize =3D conf.readEntry( "BorderSize", (int)BorderNormal ); if( bsize >=3D BorderTiny && bsize < BordersCount ) @@ -555,8 +555,8 @@ // decorationList->setSelected( // decorationList->findItem( i18n("KDE 2") ), true ); // KDE classic cli= ent =20 =2D buttonPositionWidget->setButtonsLeft("MS"); =2D buttonPositionWidget->setButtonsRight("HIAX"); + buttonPositionWidget->setButtonsLeft(KDecorationOptions::defaultTitleButt= onsLeft()); + buttonPositionWidget->setButtonsRight(KDecorationOptions::defaultTitleBut= tonsRight()); =20 border_size =3D BorderNormal; checkSupportedBorderSizes(); Index: kcmkwin/kwindecoration/preview.cpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2D-- kcmkwin/kwindecoration/preview.cpp (revision 736818) +++ kcmkwin/kwindecoration/preview.cpp (working copy) @@ -473,8 +473,8 @@ if (!customTitleButtonsRight.isNull() ) d->title_buttons_right =3D customTitleButtonsRight; } else { =2D d->title_buttons_left =3D "MS"; =2D d->title_buttons_right =3D "HIAX"; + d->title_buttons_left =3D KDecorationOptions::defaultTitleButtonsL= eft(); + d->title_buttons_right =3D KDecorationOptions::defaultTitleButtons= Right(); } =20 return changed; Index: lib/kdecoration.cpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2D-- lib/kdecoration.cpp (revision 736818) +++ lib/kdecoration.cpp (working copy) @@ -428,11 +428,21 @@ return d->title_buttons_left; } =20 +QString KDecorationOptions::defaultTitleButtonsLeft() +{ + return "AIS__HM"; +} + QString KDecorationOptions::titleButtonsRight() const { return d->title_buttons_right; } =20 +QString KDecorationOptions::defaultTitleButtonsRight() +{ + return "X"; +} + bool KDecorationOptions::showTooltips() const { return d->show_tooltips; Index: lib/kdecoration.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2D-- lib/kdecoration.h (revision 736818) +++ lib/kdecoration.h (working copy) @@ -238,25 +238,32 @@ * @li '_' spacer * * The default ( which is also returned if customButtonPositions return= s false ) =2D * is "MS". + * is "AIS__HM". * Unknown buttons in the returned string must be ignored. * The changed flags for this setting is SettingButtons. */ QString titleButtonsLeft() const; /** + * Returns the default left button sequence + */ + static QString defaultTitleButtonsLeft(); + /** * If customButtonPositions() returns true, titleButtonsRight * returns which buttons should be on the right side of the titlebar fr= om left * to right. Characters in the return string have the same meaning like * in titleButtonsLeft(). * * The default ( which is also returned if customButtonPositions return= s false ) =2D * is "HIAX". + * is "X". * Unknown buttons in the returned string must be ignored. * The changed flags for this setting is SettingButtons. */ QString titleButtonsRight() const; =2D /** + * Returns the default right button sequence. + */ + static QString defaultTitleButtonsRight(); + /** * @returns true if the style should use tooltips for window buttons * The changed flags for this setting is SettingTooltips. */ Index: lib/kcommondecoration.cpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2D-- lib/kcommondecoration.cpp (revision 736818) +++ lib/kcommondecoration.cpp (working copy) @@ -58,6 +58,16 @@ delete m_previewWidget; } =20 +QString KCommonDecoration::defaultButtonsLeft() +{ + return KDecorationOptions::defaultTitleButtonsLeft(); +} + +QString KCommonDecoration::defaultButtonsRight() +{ + return KDecorationOptions::defaultTitleButtonsRight(); +} + bool KCommonDecoration::decorationBehaviour(DecorationBehaviour behaviour)= const { switch (behaviour) { Index: lib/kcommondecoration.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2D-- lib/kcommondecoration.h (revision 736818) +++ lib/kcommondecoration.h (working copy) @@ -138,13 +138,13 @@ * @see KDecoration::titleButtonsLeft() * @see KDecoration::titleButtonsRight() */ =2D virtual QString defaultButtonsLeft() const =3D 0; + virtual QString defaultButtonsLeft(); /** * The default title button order on the left. * @see KDecoration::titleButtonsLeft() * @see KDecoration::titleButtonsRight() */ =2D virtual QString defaultButtonsRight() const =3D 0; + virtual QString defaultButtonsRight(); =20 /** * This controls whether some specific behaviour should be enabled= or not. Index: lib/kdecoration_p.cpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2D-- lib/kdecoration_p.cpp (revision 736818) +++ lib/kdecoration_p.cpp (working copy) @@ -52,8 +52,8 @@ =20 void KDecorationOptionsPrivate::defaultKWinSettings() { =2D title_buttons_left =3D "MS"; =2D title_buttons_right =3D "HIAX"; + title_buttons_left =3D "AIS__HM"; + title_buttons_right =3D "X"; custom_button_positions =3D false; show_tooltips =3D true; border_size =3D BorderNormal; @@ -172,13 +172,13 @@ custom_button_positions =3D styleConfig.readEntry("CustomButtonPositio= ns", false); if (custom_button_positions) { =2D title_buttons_left =3D styleConfig.readEntry("ButtonsOnLeft", "= MS"); =2D title_buttons_right =3D styleConfig.readEntry("ButtonsOnRight", = "HIAX"); + title_buttons_left =3D styleConfig.readEntry("ButtonsOnLeft", "AI= S__HM"); + title_buttons_right =3D styleConfig.readEntry("ButtonsOnRight", "X= "); } else { =2D title_buttons_left =3D "MS"; =2D title_buttons_right =3D "HIAX"; + title_buttons_left =3D "AIS__HM"; + title_buttons_right =3D "X"; } if( old_custom_button_positions !=3D custom_button_positions || ( custom_button_positions && --Boundary-01=_D83OHXoTp3MxUhz-- --nextPart3210277.vE5DQV1Ocb Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQBHO38D1rcusafx20MRAjGtAKCBpWaySnlLxjjZRyHvUWF0yGRdlACff8dI nQ/hUDjn9Er1H4Tku/tPZ/4= =hEYP -----END PGP SIGNATURE----- --nextPart3210277.vE5DQV1Ocb--