Changeset View
Changeset View
Standalone View
Standalone View
applets/systemtray/package/contents/ui/ExpandedRepresentation.qml
Show All 13 Lines | |||||
14 | * You should have received a copy of the GNU Library General Public | 14 | * You should have received a copy of the GNU Library General Public | ||
15 | * License along with this program; if not, write to the | 15 | * License along with this program; if not, write to the | ||
16 | * Free Software Foundation, Inc., | 16 | * Free Software Foundation, Inc., | ||
17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
18 | */ | 18 | */ | ||
19 | 19 | | |||
20 | import QtQuick 2.1 | 20 | import QtQuick 2.1 | ||
21 | import QtQuick.Layouts 1.1 | 21 | import QtQuick.Layouts 1.1 | ||
22 | import QtQuick.Window 2.13 | ||||
22 | import org.kde.plasma.core 2.0 as PlasmaCore | 23 | import org.kde.plasma.core 2.0 as PlasmaCore | ||
23 | import org.kde.plasma.components 2.0 as PlasmaComponents | 24 | import org.kde.plasma.components 2.0 as PlasmaComponents | ||
24 | import org.kde.plasma.extras 2.0 as PlasmaExtras | 25 | import org.kde.plasma.extras 2.0 as PlasmaExtras | ||
25 | 26 | | |||
26 | Item { | 27 | Item { | ||
27 | id: expandedRepresentation | 28 | id: expandedRepresentation | ||
28 | 29 | | |||
29 | //set width/height to avoid an useless Dialog resize | 30 | //set width/height to avoid an useless Dialog resize | ||
30 | width: Layout.minimumWidth | 31 | width: Layout.minimumWidth | ||
31 | height: Layout.minimumHeight | 32 | height: Layout.minimumHeight | ||
32 | Layout.minimumWidth: units.gridUnit * 24 | 33 | Layout.minimumWidth: units.gridUnit * 24 | ||
33 | Layout.minimumHeight: units.gridUnit * 21 | 34 | Layout.minimumHeight: plasmoid.configuration.sidebar ? Screen.desktopAvailableHeight : units.gridUnit * 21 | ||
34 | Layout.preferredWidth: Layout.minimumWidth | 35 | Layout.preferredWidth: Layout.minimumWidth | ||
35 | Layout.preferredHeight: Layout.minimumHeight * 1.5 | 36 | Layout.preferredHeight: plasmoid.configuration.sidebar ? Screen.desktopAvailableHeight : Layout.minimumHeight * 1.5 | ||
36 | 37 | | |||
37 | property alias activeApplet: container.activeApplet | 38 | property alias activeApplet: container.activeApplet | ||
38 | property alias hiddenLayout: hiddenItemsView.layout | 39 | property alias hiddenLayout: hiddenItemsView.layout | ||
40 | property alias cfg_sidebar: sidebarButton.checked | ||||
41 | | ||||
42 | RowLayout { | ||||
43 | anchors.top: parent.top | ||||
44 | anchors.right: parent.right | ||||
45 | | ||||
46 | PlasmaComponents.ToolButton { | ||||
47 | id: sidebarButton | ||||
48 | width: Math.round(units.gridUnit * 1.25) | ||||
49 | height: width | ||||
50 | checkable: true | ||||
51 | checked: plasmoid.configuration.sidebar | ||||
52 | onCheckedChanged: plasmoid.configuration.sidebar = checked | ||||
53 | iconSource: "transform-move-vertical" | ||||
54 | tooltip: i18n("Sidebar Mode") | ||||
55 | } | ||||
39 | 56 | | |||
40 | PlasmaComponents.ToolButton { | 57 | PlasmaComponents.ToolButton { | ||
41 | id: pinButton | 58 | id: pinButton | ||
42 | anchors.right: parent.right | | |||
43 | width: Math.round(units.gridUnit * 1.25) | 59 | width: Math.round(units.gridUnit * 1.25) | ||
44 | height: width | 60 | height: width | ||
45 | checkable: true | 61 | checkable: true | ||
46 | checked: plasmoid.configuration.pin | 62 | checked: plasmoid.configuration.pin | ||
47 | onCheckedChanged: plasmoid.configuration.pin = checked | 63 | onCheckedChanged: plasmoid.configuration.pin = checked | ||
48 | iconSource: "window-pin" | 64 | iconSource: "window-pin" | ||
49 | z: 2 | | |||
50 | tooltip: i18n("Keep Open") | 65 | tooltip: i18n("Keep Open") | ||
51 | } | 66 | } | ||
67 | } | ||||
52 | 68 | | |||
53 | PlasmaExtras.Heading { | 69 | PlasmaExtras.Heading { | ||
ngraham: Now that you added a RowLayout, this could go inside it rather than being positioned with… | |||||
It seems to me like this whole file can be rewritten with layouts (as opposed to using anchors). The problem I'm having is that even a minimal touch (putting the heading in the row layout) breaks stuff. So I've set out to just rewrite the whole thing. So far it's not great, but not awful either. filipf: It seems to me like this whole file can be rewritten with layouts (as opposed to using anchors). | |||||
54 | id: heading | 70 | id: heading | ||
55 | level: 1 | 71 | level: 1 | ||
56 | 72 | | |||
57 | anchors { | 73 | anchors { | ||
58 | left: parent.left | 74 | left: parent.left | ||
59 | top: parent.top | 75 | top: parent.top | ||
60 | right: parent.right | 76 | right: parent.right | ||
61 | topMargin: hiddenItemsView.visible ? units.smallSpacing : 0 | 77 | topMargin: hiddenItemsView.visible ? units.smallSpacing : 0 | ||
▲ Show 20 Lines • Show All 83 Lines • Show Last 20 Lines |
Now that you added a RowLayout, this could go inside it rather than being positioned with anchors