Support for Maximized/Restore buttons
This commit is contained in:
parent
5c36fcac36
commit
d78320fa65
5 changed files with 37 additions and 2 deletions
|
@ -325,6 +325,11 @@ void AuroraeClient::toggleKeepBelow()
|
|||
setKeepBelow(!keepBelow());
|
||||
}
|
||||
|
||||
bool AuroraeClient::isMaximized() const
|
||||
{
|
||||
return maximizeMode()==KDecorationDefines::MaximizeFull && !options()->moveResizeMaximizedWindows();
|
||||
}
|
||||
|
||||
void AuroraeClient::updateWindowShape()
|
||||
{
|
||||
bool maximized = maximizeMode()==KDecorationDefines::MaximizeFull && !options()->moveResizeMaximizedWindows();
|
||||
|
|
|
@ -78,7 +78,7 @@ class AuroraeClient : public KDecorationUnstable
|
|||
Q_PROPERTY(bool shadeable READ isShadeable)
|
||||
Q_PROPERTY(bool keepAbove READ keepAbove WRITE setKeepAbove NOTIFY keepAboveChangedWrapper)
|
||||
Q_PROPERTY(bool keepBelow READ keepBelow WRITE setKeepBelow NOTIFY keepBelowChangedWrapper)
|
||||
// TODO: maximize mode
|
||||
Q_PROPERTY(bool maximized READ isMaximized NOTIFY maximizeChanged)
|
||||
Q_PROPERTY(bool providesContextHelp READ providesContextHelp)
|
||||
Q_PROPERTY(QRect transparentRect READ transparentRect)
|
||||
Q_PROPERTY(int width READ width)
|
||||
|
@ -105,6 +105,7 @@ public:
|
|||
virtual void reset(long unsigned int changed);
|
||||
QString leftButtons() const;
|
||||
QString rightButtons() const;
|
||||
bool isMaximized() const;
|
||||
|
||||
Q_SIGNALS:
|
||||
void activeChanged();
|
||||
|
|
|
@ -65,6 +65,9 @@ DecorationButton {
|
|||
case "A":
|
||||
// maximize
|
||||
return auroraeTheme.maximizeButtonPath;
|
||||
case "R":
|
||||
// maximize
|
||||
return auroraeTheme.restoreButtonPath;
|
||||
case "X":
|
||||
// close
|
||||
return auroraeTheme.closeButtonPath;
|
||||
|
@ -190,6 +193,9 @@ DecorationButton {
|
|||
} else {
|
||||
visible = buttonSvg.imagePath != "";
|
||||
}
|
||||
if (buttonType == "R") {
|
||||
visible = decoration.maximized;
|
||||
}
|
||||
}
|
||||
onHoveredChanged: {
|
||||
if (state == "active-pressed" || state == "inactive-pressed") {
|
||||
|
@ -325,5 +331,22 @@ DecorationButton {
|
|||
state = "active";
|
||||
}
|
||||
}
|
||||
onMaximizedChanged: {
|
||||
if (buttonType != "A" && buttonType != "R") {
|
||||
return;
|
||||
}
|
||||
if (auroraeTheme.restoreButtonPath != "") {
|
||||
if (buttonType == "A") {
|
||||
visible = !decoration.maximized;
|
||||
} else if (buttonType == "R") {
|
||||
visible = decoration.maximized;
|
||||
}
|
||||
if (!decoration.active && buttonSvg.supportsInactive) {
|
||||
state = "inactive";
|
||||
} else {
|
||||
state = "active";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,6 +32,9 @@ Item {
|
|||
groupRow, "menuButton" + buttons + i);
|
||||
} else {
|
||||
component.createObject(groupRow, {buttonType: buttons.charAt(i)});
|
||||
if (buttons.charAt(i) == "A") {
|
||||
component.createObject(groupRow, {buttonType: "R"});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,6 +27,7 @@ Item {
|
|||
case "X":
|
||||
return decoration.closeable;
|
||||
case "A":
|
||||
case "R":
|
||||
return decoration.maximizeable;
|
||||
case "I":
|
||||
return decoration.minimizeable;
|
||||
|
@ -43,6 +44,7 @@ Item {
|
|||
case "M":
|
||||
return Qt.LeftButton | Qt.RightButton;
|
||||
case "A":
|
||||
case "R":
|
||||
return Qt.LeftButton | Qt.RightButton | Qt.MiddleButton;
|
||||
default:
|
||||
return Qt.LeftButton;
|
||||
|
@ -73,8 +75,9 @@ Item {
|
|||
decoration.minimize();
|
||||
break;
|
||||
case "A":
|
||||
case "R":
|
||||
// maximize
|
||||
decoration.maximize(mouse.buttons);
|
||||
decoration.maximize(mouse.button);
|
||||
break;
|
||||
case "X":
|
||||
// close
|
||||
|
|
Loading…
Reference in a new issue