Skip to content

Commit 7e6f8ee

Browse files
authored
Merge pull request #47 from nemomobile-ux/remove_headerTools
Remove header tools
2 parents 21c9139 + ed132f0 commit 7e6f8ee

File tree

11 files changed

+46
-525
lines changed

11 files changed

+46
-525
lines changed

examples/touch/glacier-components.qml

Lines changed: 1 addition & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/****************************************************************************
22
**
33
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
4-
** Copyright (C) 2017-2023 Chupligin Sergey <neochapay@gmail.com>
4+
** Copyright (C) 2017-2025 Chupligin Sergey <neochapay@gmail.com>
55
** Contact: http://www.qt-project.org/legal
66
**
77
** This file is part of the Qt Quick Controls module of the Qt Toolkit.
@@ -182,120 +182,6 @@ ApplicationWindow {
182182
showZeroCounter: true
183183
}
184184
]
185-
186-
//The parent of these items is null when this ToolsLayout is not used
187-
//(i.e. you're on a different page) so we need to check the parent,
188-
//just like in MeeGo's ToolbarLayout (when you don't use the automatic layout)
189-
190-
//TODO: Add automatic layout logic (see ToolbarLayout in MeeGo)
191-
drawerLevels: [
192-
Button {
193-
anchors.horizontalCenter: (parent==undefined) ? undefined : parent.horizontalCenter;
194-
text: qsTr("Black theme")
195-
primary: Theme.themePath == "/usr/lib/qt/qml/QtQuick/Controls/Styles/Nemo/themes/glacier_black.json"
196-
onClicked: {
197-
Theme.loadTheme("/usr/lib/qt/qml/QtQuick/Controls/Styles/Nemo/themes/glacier_black.json")
198-
}
199-
},
200-
Button {
201-
anchors.horizontalCenter: (parent==undefined) ? undefined : parent.horizontalCenter;
202-
text: qsTr("White theme")
203-
primary: Theme.themePath == "/usr/lib/qt/qml/QtQuick/Controls/Styles/Nemo/themes/glacier_white.json"
204-
onClicked: {
205-
Theme.loadTheme("/usr/lib/qt/qml/QtQuick/Controls/Styles/Nemo/themes/glacier_white.json")
206-
}
207-
},
208-
Row {
209-
id: drawerTestRow
210-
width: appWindow.width
211-
height: Theme.itemHeightMedium
212-
213-
anchors{
214-
left: (parent==undefined) ? undefined : parent.left
215-
right: (parent==undefined) ? undefined : parent.right
216-
margins: Theme.itemSpacingLarge
217-
}
218-
219-
Label {
220-
id: drawerTestLabel
221-
text: qsTr("Drawer Test")
222-
anchors.verticalCenter: parent.verticalCenter
223-
}
224-
225-
Rectangle{
226-
id: spacer1
227-
width: parent.width-drawerTestLabel.width-drawerTestCheckBox.width
228-
color: "transparent"
229-
height: 1
230-
}
231-
232-
CheckBox {
233-
id: drawerTestCheckBox
234-
anchors.verticalCenter: parent.verticalCenter
235-
}
236-
},
237-
Row{
238-
id: drawerTest2Row
239-
width: appWindow.width
240-
height: Theme.itemHeightMedium
241-
242-
anchors{
243-
left: (parent==undefined) ? undefined : parent.left
244-
right: (parent==undefined) ? undefined : parent.right
245-
margins: Theme.itemSpacingLarge
246-
}
247-
248-
Label {
249-
id: drawerTest2Label
250-
text: qsTr("Drawer Test 2")
251-
anchors.verticalCenter: parent.verticalCenter
252-
}
253-
254-
Rectangle{
255-
id: spacer2
256-
width: parent.width-drawerTest2Label.width-tool1.width-tool2.width-tool3.width
257-
color: "transparent"
258-
height: 1
259-
}
260-
261-
ToolButton {
262-
id: tool1
263-
iconSource: "image://theme/cog"
264-
anchors.verticalCenter: parent.verticalCenter
265-
}
266-
ToolButton {
267-
id: tool2
268-
iconSource: "image://theme/edit"
269-
anchors.verticalCenter: parent.verticalCenter
270-
}
271-
ToolButton {
272-
id: tool3
273-
iconSource: "image://theme/refresh"
274-
anchors.verticalCenter: parent.verticalCenter
275-
}
276-
},
277-
ButtonRow {
278-
id: buttonRowExample
279-
model: ListModel {
280-
ListElement {
281-
name: "swim"
282-
}
283-
ListElement {
284-
name: "cruise"
285-
}
286-
ListElement {
287-
name: "row"
288-
}
289-
ListElement {
290-
name: "fish"
291-
}
292-
ListElement {
293-
name: "dive"
294-
}
295-
}
296-
}
297-
298-
]
299185
}
300186
}
301187
}

src/controls/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ set(QML
3232
qml/GlacierRollerItem.qml
3333
qml/GlacierRoller.qml
3434
qml/Header.qml
35-
qml/HeaderToolsIndicator.qml
35+
3636
qml/HeaderToolsLayout.qml
3737
qml/IconButton.qml
3838
qml/Label.qml

src/controls/qml/ApplicationWindow.qml

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Copyright (C) 2013 Andrea Bernabei <and.bernabei@gmail.com>
33
* Copyright (C) 2013 Jolla Ltd.
44
* Copyright (C) 2017 Eetu Kahelin
5-
* Copyright (C) 2021-2023 Chupligin Sergey (NeoChapay) <neochapay@gmail.com>
5+
* Copyright (C) 2021-2025 Chupligin Sergey (NeoChapay) <neochapay@gmail.com>
66
*
77
* This library is free software; you can redistribute it and/or
88
* modify it under the terms of the GNU Library General Public
@@ -54,11 +54,7 @@ NemoWindow {
5454
}
5555
var component = Qt.createComponent(url)
5656
if (component.status === Component.Ready) {
57-
if(mainMenuArea.width != applicationWindow.width && mainMenuArea.width != 0) {
58-
pageStack.replace(component.createObject(pageStack, params))
59-
} else {
60-
pageStack.push(component.createObject(pageStack, params))
61-
}
57+
pageStack.push(component.createObject(pageStack, params))
6258
} else {
6359
console.warn("Error loading component", url, component.errorString())
6460
pageStack.push(Qt.resolvedUrl("ErrorStackPage.qml"), {error: component.errorString()})
@@ -184,23 +180,33 @@ NemoWindow {
184180
height: parent.height
185181
clip: true
186182
visible: width != 0
187-
width: if(sourceComponent === null) {
188-
return 0
189-
} else if (applicationWindow.isUiPortrait) {
190-
if(stackView.depth == 1) {
191-
return parent.width
192-
} else {
193-
return 0
194-
}
195-
196-
} else {
197-
return applicationWindow.mainMenuWidth
198-
}
183+
width: recalcMainMenuWidth()
199184

200185
anchors{
201186
top: applicationWindow.isUiPortrait ? toolBar.bottom : parent.top
202187
left: applicationWindow.isUiPortrait ? parent.left : toolBar.right
203188
}
189+
190+
function recalcMainMenuWidth() {
191+
if(sourceComponent === null) {
192+
return 0
193+
} else if (applicationWindow.isUiPortrait) {
194+
if(stackView.depth <= 1) {
195+
return parent.width
196+
} else {
197+
return 0
198+
}
199+
} else {
200+
return Theme.itemWidthExtraLarge
201+
}
202+
}
203+
204+
Connections{
205+
target: applicationWindow
206+
function onIsUiPortraitChanged() {
207+
mainMenuArea.recalcMainMenuWidth()
208+
}
209+
}
204210
}
205211

206212

@@ -214,9 +220,9 @@ NemoWindow {
214220
property real panelSize: 0
215221
property real previousImSize: 0
216222
property real imSize: !Qt.application.active ? 0 : (isUiPortrait ? (applicationWindow._transpose ? Qt.inputMethod.keyboardRectangle.width
217-
: Qt.inputMethod.keyboardRectangle.height)
223+
: Qt.inputMethod.keyboardRectangle.height)
218224
: (applicationWindow._transpose ? Qt.inputMethod.keyboardRectangle.height
219-
: Qt.inputMethod.keyboardRectangle.width))
225+
: Qt.inputMethod.keyboardRectangle.width))
220226

221227

222228
// TODO: fix on landscape and inverted landscape

0 commit comments

Comments
 (0)