summaryrefslogtreecommitdiffstats
path: root/mobile-widgets/3rdparty/0007-breadcrumbs-deal-with-incorrect-height-of-title-bar.patch
blob: b887cbc269f8253122a848b8a673c18cf22f8162 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
From 59e39f536be6a646b93ad6403aa375ec7ec4181b Mon Sep 17 00:00:00 2001
From: Dirk Hohndel <dirk@hohndel.org>
Date: Thu, 3 Dec 2020 13:51:36 -0800
Subject: [PATCH 7/11] improve the title bar visual

Subsurface doesn't do theming the way Kirigami intends us to do this.
Part of the reason is that our original approach pre-dates Kirigami
doing this at all, part of it is that we want to allow theme changes
independent from the OS which doesn't seem to be something that the
Kirigami developers have considered.
I'm sure we could do a better job using what is available in Kirigami,
this seems a little brute force, but it works.

This commit hard codes some colors to use the ones from the Subsurface
theme (which is of course the wrong thing to do for a generic library),
makes sure we find the icons, and makes sure that size of the title bar
stays correct.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>

---
 .../globaltoolbar/PageRowGlobalToolBarUI.qml  | 22 +++++++++++++++----
 src/controls/templates/private/BackButton.qml |  1 +
 .../templates/private/ForwardButton.qml       |  1 +
 3 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/src/controls/private/globaltoolbar/PageRowGlobalToolBarUI.qml b/src/controls/private/globaltoolbar/PageRowGlobalToolBarUI.qml
index 4404faae..afbfce89 100644
--- a/src/controls/private/globaltoolbar/PageRowGlobalToolBarUI.qml
+++ b/src/controls/private/globaltoolbar/PageRowGlobalToolBarUI.qml
@@ -29,12 +29,23 @@ Kirigami.AbstractApplicationHeader {
     maximumHeight: globalToolBar.maximumHeight
     separatorVisible: globalToolBar.separatorVisible
 
-    Kirigami.Theme.textColor: currentItem ? currentItem.Kirigami.Theme.textColor : parent.Kirigami.Theme.textColor
+    // provide consistent color for the Subsurface title bar - I couldn't figure
+    // how to do this without modifying Kirigami itself
+    Kirigami.Theme.backgroundColor: subsurfaceTheme.primaryColor
+    Kirigami.Theme.textColor: subsurfaceTheme.primaryTextColor
 
     RowLayout {
         anchors.fill: parent
         spacing: 0
 
+        // I can't make the layout work without this invisible rectangle to anchor things on
+        Rectangle {
+                id: correct
+                height: parent.height
+                width: 0
+                color: "transparent"
+        }
+
         Item {
             id: leftHandleAnchor
             visible: (typeof applicationWindow() !== "undefined" && applicationWindow().globalDrawer && applicationWindow().globalDrawer.enabled && applicationWindow().globalDrawer.handleVisible &&
@@ -67,6 +78,7 @@ Kirigami.AbstractApplicationHeader {
             Layout.fillHeight: true
 
             Layout.leftMargin: leftHandleAnchor.visible ? Kirigami.Units.smallSpacing : 0
+            Layout.alignment: Qt.AlignTop | Qt.AlignVCenter
 
             visible: (globalToolBar.showNavigationButtons != Kirigami.ApplicationHeaderStyle.NoNavigationButtons || root.layers.depth > 0) && (globalToolBar.actualStyle != Kirigami.ApplicationHeaderStyle.None)
 
@@ -76,16 +88,18 @@ Kirigami.AbstractApplicationHeader {
                 id: backButton
                 Layout.leftMargin: leftHandleAnchor.visible ? 0 : Kirigami.Units.smallSpacing
                 Layout.preferredWidth: height
-                Layout.maximumHeight: buttonsLayout.height
+                Layout.topMargin: 0
+                Layout.maximumHeight: correct.height
             }
             TemplatesPrivate.ForwardButton {
-                Layout.maximumHeight: buttonsLayout.height
+                Layout.maximumHeight: correct.height
                 Layout.preferredWidth: height
             }
         }
 
         QQC2.ToolSeparator {
             visible: (menuButton.visible || (buttonsLayout.visible && buttonsLayout.visibleChildren.length > 0)) && breadcrumbVisible && pageRow.depth > 1
+            Layout.maximumHeight: correct.height
         }
 
         Loader {
@@ -124,6 +138,6 @@ Kirigami.AbstractApplicationHeader {
             Layout.preferredWidth: height
         }
     }
-    background.opacity: breadcrumbLoader.opacity
+    //background.opacity: breadcrumbLoader.opacity
 }
 
diff --git a/src/controls/templates/private/BackButton.qml b/src/controls/templates/private/BackButton.qml
index 85a46d15..d1076080 100644
--- a/src/controls/templates/private/BackButton.qml
+++ b/src/controls/templates/private/BackButton.qml
@@ -14,6 +14,7 @@ Controls.ToolButton {
     id: button
 
     icon.name: (LayoutMirroring.enabled ? "go-previous-symbolic-rtl" : "go-previous-symbolic")
+    icon.source: (LayoutMirroring.enabled ? "go-previous-symbolic-rtl" : "go-previous-symbolic")
 
     enabled: applicationWindow().pageStack.layers.depth > 1 || (applicationWindow().pageStack.depth > 1 && (applicationWindow().pageStack.currentIndex > 0 || applicationWindow().pageStack.contentItem.contentX > 0))
 
diff --git a/src/controls/templates/private/ForwardButton.qml b/src/controls/templates/private/ForwardButton.qml
index c756e030..68a3901b 100644
--- a/src/controls/templates/private/ForwardButton.qml
+++ b/src/controls/templates/private/ForwardButton.qml
@@ -14,6 +14,7 @@ Controls.ToolButton {
     id: button
 
     icon.name: (LayoutMirroring.enabled ? "go-next-symbolic-rtl" : "go-next-symbolic")
+    icon.source: (LayoutMirroring.enabled ? "go-next-symbolic-rtl" : "go-next-symbolic")
 
     enabled: applicationWindow().pageStack.currentIndex < applicationWindow().pageStack.depth-1
 
-- 
2.25.1