diff --git a/clients/aurorae/src/decorationoptions.h b/clients/aurorae/src/decorationoptions.h index 4f469fec16..d32546b32f 100644 --- a/clients/aurorae/src/decorationoptions.h +++ b/clients/aurorae/src/decorationoptions.h @@ -120,7 +120,9 @@ public: BorderVeryLarge, ///< Very large borders BorderHuge, ///< Huge borders BorderVeryHuge, ///< Very huge borders - BorderOversized ///< Oversized borders + BorderOversized, ///< Oversized borders + BorderNoSides, ///< No borders on sides + BorderNone ///< No borders except title }; explicit DecorationOptions(QObject *parent = 0); virtual ~DecorationOptions(); diff --git a/clients/aurorae/themes/plastik/package/contents/ui/main.qml b/clients/aurorae/themes/plastik/package/contents/ui/main.qml index f868fe79e7..6fcde9897d 100644 --- a/clients/aurorae/themes/plastik/package/contents/ui/main.qml +++ b/clients/aurorae/themes/plastik/package/contents/ui/main.qml @@ -31,35 +31,50 @@ Decoration { root.extendedBorderBottom = 0; root.extendedBorderLeft = 0; } + function setBorderSize(value) { + root.borderLeft = value; + root.borderRight = value; + root.borderBottom = value; + } function readConfig() { switch (decoration.readConfig("BorderSize", DecorationOptions.BorderNormal)) { case DecorationOptions.BorderTiny: - root.borderSize = 3; - enableExtendedBorders(); + setBorderSize(3); + disableExtendedBorders(); break; case DecorationOptions.BorderLarge: - root.borderSize = 8; + setBorderSize(8); disableExtendedBorders(); break; case DecorationOptions.BorderVeryLarge: - root.borderSize = 12; + setBorderSize(12); disableExtendedBorders(); break; case DecorationOptions.BorderHuge: - root.borderSize = 18; + setBorderSize(18); disableExtendedBorders(); break; case DecorationOptions.BorderVeryHuge: - root.borderSize = 27; + setBorderSize(27); disableExtendedBorders(); break; case DecorationOptions.BorderOversized: - root.borderSize = 40; + setBorderSize(40); disableExtendedBorders(); break; + case DecorationOptions.BorderNoSides: + root.borderLeft = 1; + root.borderRight = 1; + root.borderBottom = 4; + enableExtendedBorders(); + break; + case DecorationOptions.BorderNone: + setBorderSize(1); + enableExtendedBorders(); + break; case DecorationOptions.BorderNormal: // fall through to default default: - root.borderSize = 4; + setBorderSize(4); disableExtendedBorders(); break; } @@ -99,12 +114,11 @@ Decoration { duration: root.animationDuration } } - property int borderSize: 4 id: root - borderLeft: borderSize - borderRight: borderSize + borderLeft: 4 + borderRight: 4 borderTop: top.normalHeight - borderBottom: borderSize + borderBottom: 4 borderLeftMaximized: 0 borderRightMaximized: 0 borderBottomMaximized: 0 diff --git a/kcmkwin/kwindecoration/configdialog.cpp b/kcmkwin/kwindecoration/configdialog.cpp index a047c44d0e..a97954519b 100644 --- a/kcmkwin/kwindecoration/configdialog.cpp +++ b/kcmkwin/kwindecoration/configdialog.cpp @@ -35,7 +35,9 @@ static const char* const border_names[ KDecorationDefines::BordersCount ] = { I18N_NOOP2("@item:inlistbox Border size:", "Very Large"), I18N_NOOP2("@item:inlistbox Border size:", "Huge"), I18N_NOOP2("@item:inlistbox Border size:", "Very Huge"), - I18N_NOOP2("@item:inlistbox Border size:", "Oversized") + I18N_NOOP2("@item:inlistbox Border size:", "Oversized"), + I18N_NOOP2("@item:inlistbox Border size:", "No Side Border"), + I18N_NOOP2("@item:inlistbox Border size:", "No Border"), }; KWinAuroraeConfigForm::KWinAuroraeConfigForm(QWidget* parent) @@ -44,6 +46,15 @@ KWinAuroraeConfigForm::KWinAuroraeConfigForm(QWidget* parent) setupUi(this); } +void KWinAuroraeConfigForm::enableNoSideBorderSupport(bool enable) +{ + if (!enable) { + return; + } + borderSizesCombo->addItem(i18nc("@item:inlistbox Border size:", border_names[KDecorationDefines::BorderBottom])); + borderSizesCombo->addItem(i18nc("@item:inlistbox Border size:", border_names[KDecorationDefines::BorderNone])); +} + KWinDecorationConfigForm::KWinDecorationConfigForm(QWidget* parent) : QWidget(parent) { diff --git a/kcmkwin/kwindecoration/configdialog.h b/kcmkwin/kwindecoration/configdialog.h index f07befc808..5eb81d1601 100644 --- a/kcmkwin/kwindecoration/configdialog.h +++ b/kcmkwin/kwindecoration/configdialog.h @@ -34,6 +34,7 @@ class KWinAuroraeConfigForm : public QWidget, public Ui::KWinAuroraeConfigForm public: explicit KWinAuroraeConfigForm(QWidget* parent); + void enableNoSideBorderSupport(bool enable); }; class KWinDecorationConfigForm : public QWidget, public Ui::KWinDecorationConfigForm diff --git a/kcmkwin/kwindecoration/kwindecoration.cpp b/kcmkwin/kwindecoration/kwindecoration.cpp index 8e66099ff3..1fe283a0b9 100644 --- a/kcmkwin/kwindecoration/kwindecoration.cpp +++ b/kcmkwin/kwindecoration/kwindecoration.cpp @@ -377,6 +377,7 @@ void KWinDecorationModule::slotConfigureDecoration() dlg->setCaption(i18n("Decoration Options")); dlg->setButtons(KDialog::Ok | KDialog::Cancel); KWinAuroraeConfigForm *form = new KWinAuroraeConfigForm(dlg); + form->enableNoSideBorderSupport(index.data(DecorationModel::TypeRole).toInt() == DecorationModelData::QmlDecoration); dlg->setMainWidget(form); form->borderSizesCombo->setCurrentIndex(index.data(DecorationModel::BorderSizeRole).toInt()); form->buttonSizesCombo->setCurrentIndex(index.data(DecorationModel::ButtonSizeRole).toInt()); diff --git a/libkdecorations/kdecoration.h b/libkdecorations/kdecoration.h index e37fd6275b..2c20767d9f 100644 --- a/libkdecorations/kdecoration.h +++ b/libkdecorations/kdecoration.h @@ -176,6 +176,8 @@ public: BorderHuge, ///< Huge borders BorderVeryHuge, ///< Very huge borders BorderOversized, ///< Oversized borders + BorderNoSides, ///< No borders on sides @since 4.11 + BorderNone, ///< No borders except title @since 4.11 BordersCount ///< @internal };