summaryrefslogtreecommitdiffstats
path: root/mobile-widgets/3rdparty/0007-breadcrumbs-deal-with-incorrect-height-of-title-bar.patch
blob: f1fae6fbcd431eeb1d7044b92cb2ca757de244d1 (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
From 766da540c8859cc0983b73726dab3ce743109c16 Mon Sep 17 00:00:00 2001
From: Dirk Hohndel <dirk@hohndel.org>
Date: Thu, 3 Dec 2020 13:51:36 -0800
Subject: [PATCH 07/11] breadcrumbs: deal with incorrect height of title bar

I can see that the Kirigami developers have made changes here, but
this still doesn't work without that invisible element.

This also hardcodes our background color for the title bar as that
theming always goes wrong.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
---
 .../globaltoolbar/PageRowGlobalToolBarUI.qml   | 18 +++++++++++++++---
 src/controls/templates/private/BackButton.qml  |  1 +
 .../templates/private/ForwardButton.qml        |  1 +
 3 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/src/controls/private/globaltoolbar/PageRowGlobalToolBarUI.qml b/src/controls/private/globaltoolbar/PageRowGlobalToolBarUI.qml
index 4404faae..e0b26e88 100644
--- a/src/controls/private/globaltoolbar/PageRowGlobalToolBarUI.qml
+++ b/src/controls/private/globaltoolbar/PageRowGlobalToolBarUI.qml
@@ -28,6 +28,7 @@ Kirigami.AbstractApplicationHeader {
     preferredHeight: globalToolBar.preferredHeight
     maximumHeight: globalToolBar.maximumHeight
     separatorVisible: globalToolBar.separatorVisible
+    background: Rectangle { color: subsurfaceTheme.primaryColor }
 
     Kirigami.Theme.textColor: currentItem ? currentItem.Kirigami.Theme.textColor : parent.Kirigami.Theme.textColor
 
@@ -35,6 +36,14 @@ Kirigami.AbstractApplicationHeader {
         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 +76,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 +86,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 +136,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