fix #978,dont overlap pin/advanced buttons

pull/2/head
Michail Vourlakos 7 years ago
parent a04bee5cc2
commit 8cfbb67d3c

@ -64,40 +64,6 @@ FocusScope {
enabledBorders: dockConfig.enabledBorders enabledBorders: dockConfig.enabledBorders
} }
PlasmaComponents.ToolButton {
id: pinButton
anchors.right: parent.right
anchors.top: parent.top
//!avoid editMode box shadow
anchors.topMargin: units.smallSpacing
anchors.rightMargin: units.smallSpacing
Layout.fillWidth: false
Layout.fillHeight: false
Layout.preferredWidth: width
Layout.preferredHeight: height
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
iconSource: "window-pin"
checkable: true
width: Math.round(units.gridUnit * 1.25)
height: width
property bool inStartup: true
onClicked: {
plasmoid.configuration.configurationSticker = checked
dockConfig.setSticker(checked)
}
Component.onCompleted: {
checked = plasmoid.configuration.configurationSticker
dockConfig.setSticker(plasmoid.configuration.configurationSticker)
}
}
ColumnLayout { ColumnLayout {
id: content id: content
@ -246,59 +212,96 @@ FocusScope {
Layout.minimumHeight: advancedSettings.height + 2*units.smallSpacing Layout.minimumHeight: advancedSettings.height + 2*units.smallSpacing
} }
RowLayout { ColumnLayout {
id: advancedSettings PlasmaComponents.ToolButton {
Layout.fillWidth: true id: pinButton
Layout.rightMargin: units.smallSpacing * 2
Layout.alignment: Qt.AlignRight | Qt.AlignBottom
PlasmaComponents.Label { anchors.right: parent.right
Layout.fillWidth: true anchors.top: parent.top
Layout.alignment: Qt.AlignRight //!avoid editMode box shadow
} anchors.topMargin: units.smallSpacing
anchors.rightMargin: units.smallSpacing
PlasmaComponents.Label { Layout.fillWidth: false
text: i18n("Advanced") Layout.fillHeight: false
Layout.alignment: Qt.AlignRight Layout.preferredWidth: width
opacity: plasmoid.configuration.advanced ? 1 : 0.3 Layout.preferredHeight: height
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
MouseArea { Layout.bottomMargin: units.smallSpacing * 3
anchors.fill: parent
onClicked: { iconSource: "window-pin"
plasmoid.configuration.advanced = !advancedSwitch.checked; checkable: true
advancedSwitch.checked = plasmoid.configuration.advanced;
} width: Math.round(units.gridUnit * 1.25)
height: width
property bool inStartup: true
onClicked: {
plasmoid.configuration.configurationSticker = checked
dockConfig.setSticker(checked)
}
Component.onCompleted: {
checked = plasmoid.configuration.configurationSticker
dockConfig.setSticker(plasmoid.configuration.configurationSticker)
} }
} }
Switch { RowLayout {
id: advancedSwitch id: advancedSettings
checked: plasmoid.configuration.advanced Layout.fillWidth: true
Layout.rightMargin: units.smallSpacing * 2
Layout.alignment: Qt.AlignRight | Qt.AlignBottom
onPressedChanged: { PlasmaComponents.Label {
if(pressed) Layout.fillWidth: true
plasmoid.configuration.advanced = !checked; Layout.alignment: Qt.AlignRight
} }
style: Styles.SwitchStyle { PlasmaComponents.Label {
property bool checked: advancedSwitch.checked text: i18n("Advanced")
} Layout.alignment: Qt.AlignRight
opacity: plasmoid.configuration.advanced ? 1 : 0.3
onCheckedChanged: { MouseArea {
if (!checked && tabGroup.currentTab === tweaksPage) { anchors.fill: parent
if (tasksTabBtn.visible) { onClicked: {
tabGroup.currentTab = tasksPage; plasmoid.configuration.advanced = !advancedSwitch.checked;
tabBar.currentTab = tasksTabBtn; advancedSwitch.checked = plasmoid.configuration.advanced;
} else {
tabGroup.currentTab = appearancePage;
tabBar.currentTab = appearanceTabBtn;
} }
} }
}
Switch {
id: advancedSwitch
checked: plasmoid.configuration.advanced
onPressedChanged: {
if(pressed)
plasmoid.configuration.advanced = !checked;
}
style: Styles.SwitchStyle {
property bool checked: advancedSwitch.checked
}
onCheckedChanged: {
if (!checked && tabGroup.currentTab === tweaksPage) {
if (tasksTabBtn.visible) {
tabGroup.currentTab = tasksPage;
tabBar.currentTab = tasksTabBtn;
} else {
tabGroup.currentTab = appearancePage;
tabBar.currentTab = appearanceTabBtn;
}
}
if (checked) { if (checked) {
dockConfig.createSecondaryWindow(); dockConfig.createSecondaryWindow();
} else { } else {
dockConfig.deleteSecondaryWindow(); dockConfig.deleteSecondaryWindow();
}
} }
} }
} }

Loading…
Cancel
Save