Application Menu button support for Plastik
New icon with three lines similar to the one used in Oxygen is added for application menu support. REVIEW: 107937icc-effect-5.14.5
parent
7163c9faf4
commit
54479225a3
|
@ -91,6 +91,8 @@ QPixmap PlastikButtonProvider::requestPixmap(const QString &id, QSize *size, con
|
||||||
} else {
|
} else {
|
||||||
button = ShadeIcon;
|
button = ShadeIcon;
|
||||||
}
|
}
|
||||||
|
} else if (idParts[0] == "N") {
|
||||||
|
button = AppMenuIcon;
|
||||||
} else {
|
} else {
|
||||||
// not recognized icon
|
// not recognized icon
|
||||||
return QDeclarativeImageProvider::requestPixmap(id, size, requestedSize);
|
return QDeclarativeImageProvider::requestPixmap(id, size, requestedSize);
|
||||||
|
@ -360,6 +362,13 @@ QPixmap PlastikButtonProvider::icon(ButtonIcon icon, int size, bool active, bool
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case AppMenuIcon:
|
||||||
|
{
|
||||||
|
drawObject(p, HorizontalLine, r.x(), r.top()+(lwTitleBar-1), r.width(), lwTitleBar);
|
||||||
|
drawObject(p, HorizontalLine, r.x(), r.center().y(), r.width(), lwTitleBar);
|
||||||
|
drawObject(p, HorizontalLine, r.x(), r.bottom()-(lwTitleBar-1), r.width(), lwTitleBar);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -43,6 +43,7 @@ private:
|
||||||
NoKeepBelowIcon,
|
NoKeepBelowIcon,
|
||||||
ShadeIcon,
|
ShadeIcon,
|
||||||
UnShadeIcon,
|
UnShadeIcon,
|
||||||
|
AppMenuIcon,
|
||||||
NumButtonIcons
|
NumButtonIcons
|
||||||
};
|
};
|
||||||
enum Object {
|
enum Object {
|
||||||
|
|
|
@ -143,11 +143,19 @@ DecorationButton {
|
||||||
if (buttonType == "H") {
|
if (buttonType == "H") {
|
||||||
visible = decoration.providesContextHelp;
|
visible = decoration.providesContextHelp;
|
||||||
}
|
}
|
||||||
|
if (buttonType == "N") {
|
||||||
|
visible = decoration.appMenu;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
onHoveredChanged: colorize()
|
onHoveredChanged: colorize()
|
||||||
onPressedChanged: colorize()
|
onPressedChanged: colorize()
|
||||||
Connections {
|
Connections {
|
||||||
target: decoration
|
target: decoration
|
||||||
onActiveChanged: button.colorize()
|
onActiveChanged: button.colorize()
|
||||||
|
onAppMenuChanged: {
|
||||||
|
if (buttonType == "N") {
|
||||||
|
visible = decoration.appMenu;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -267,6 +267,7 @@ Decoration {
|
||||||
spacing: 1
|
spacing: 1
|
||||||
explicitSpacer: root.buttonSize
|
explicitSpacer: root.buttonSize
|
||||||
menuButton: menuButtonComponent
|
menuButton: menuButtonComponent
|
||||||
|
appMenuButton: appMenuButtonComponent
|
||||||
minimizeButton: minimizeButtonComponent
|
minimizeButton: minimizeButtonComponent
|
||||||
maximizeButton: maximizeButtonComponent
|
maximizeButton: maximizeButtonComponent
|
||||||
keepBelowButton: keepBelowButtonComponent
|
keepBelowButton: keepBelowButtonComponent
|
||||||
|
@ -305,6 +306,7 @@ Decoration {
|
||||||
spacing: 1
|
spacing: 1
|
||||||
explicitSpacer: root.buttonSize
|
explicitSpacer: root.buttonSize
|
||||||
menuButton: menuButtonComponent
|
menuButton: menuButtonComponent
|
||||||
|
appMenuButton: appMenuButtonComponent
|
||||||
minimizeButton: minimizeButtonComponent
|
minimizeButton: minimizeButtonComponent
|
||||||
maximizeButton: maximizeButtonComponent
|
maximizeButton: maximizeButtonComponent
|
||||||
keepBelowButton: keepBelowButtonComponent
|
keepBelowButton: keepBelowButtonComponent
|
||||||
|
@ -402,6 +404,13 @@ Decoration {
|
||||||
height: root.buttonSize
|
height: root.buttonSize
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Component {
|
||||||
|
id: appMenuButtonComponent
|
||||||
|
PlastikButton {
|
||||||
|
buttonType: "N"
|
||||||
|
size: root.buttonSize
|
||||||
|
}
|
||||||
|
}
|
||||||
Component.onCompleted: readConfig()
|
Component.onCompleted: readConfig()
|
||||||
Connections {
|
Connections {
|
||||||
target: decoration
|
target: decoration
|
||||||
|
|
Loading…
Reference in New Issue