NavigationBar2 control #358

Manually merged
promag merged 8 commits from navbar2 into main 2023-11-10 17:28:06 +00:00 AGit
promag commented 2023-08-27 20:39:46 +00:00 (Migrated from github.com)

This is an alternative to the existing NavigationBar component. The layout is such that the center section is horizontally centered when possible, and the right section is right aligned. Also, Loaders are avoided with this new approach.

Since the approach is quite different from the other navigation bar, a full refactor would be substantial, harder to test and subject to breaking changes. For that reason, both implementations will be available for a short period of time. More pull requests will follow to replace the old implementation once this is accepted.

Finally, the new navigation bar is used on the Peers, NodeRunner, and ThemeSettings pages.

This is an alternative to the existing `NavigationBar` component. The layout is such that the center section is horizontally centered when possible, and the right section is right aligned. Also, `Loader`s are avoided with this new approach. Since the approach is quite different from the other navigation bar, a full refactor would be substantial, harder to test and subject to breaking changes. For that reason, both implementations will be available for a short period of time. More pull requests will follow to replace the old implementation once this is accepted. Finally, the new navigation bar is used on the `Peers`, `NodeRunner`, and `ThemeSettings` pages.
pablomartin4btc (Migrated from github.com) reviewed 2023-08-31 16:31:07 +00:00
pablomartin4btc (Migrated from github.com) left a comment

tested ACK, desktop ver built on Ubuntu 22.04.

I've build #343 on top of this and used NavBar2 for the popup and the title was centered more accurately.

tested ACK, desktop ver built on Ubuntu 22.04. I've build #343 on top of this and used NavBar2 for the popup and the title was centered more accurately.
jarolrod (Migrated from github.com) reviewed 2023-09-06 21:33:54 +00:00
jarolrod (Migrated from github.com) left a comment

Concept ACK

Concept ACK
jarolrod commented 2023-09-08 07:44:39 +00:00 (Migrated from github.com)

a full refactor would be substantial, harder to test and subject to breaking changes. For that reason, both implementations will be available for a short period of time. More pull requests will follow to replace the old implementation once this is accepted.

In that case, number the PR's and add a title for the series: (1/n) Reimplement NavigationBar Control

> a full refactor would be substantial, harder to test and subject to breaking changes. For that reason, both implementations will be available for a short period of time. More pull requests will follow to replace the old implementation once this is accepted. In that case, number the PR's and add a title for the series: (1/n) Reimplement NavigationBar Control
jarolrod (Migrated from github.com) reviewed 2023-09-08 07:44:50 +00:00
jarolrod (Migrated from github.com) commented 2023-09-08 07:39:50 +00:00

This loses it's right padding

Master PR
Screenshot 2023-09-08 at 2 39 22 AM Screenshot 2023-09-08 at 2 36 08 AM
This loses it's right padding | Master | PR | | ------ | -- | | <img width="106" alt="Screenshot 2023-09-08 at 2 39 22 AM" src="https://git.fish.foo/attachments/8e9a1f60-6981-424c-ab8b-73a1ccc82d40"> | <img width="124" alt="Screenshot 2023-09-08 at 2 36 08 AM" src="https://git.fish.foo/attachments/61055d94-025a-4320-b6f6-d19946b4758f"> |
jarolrod (Migrated from github.com) commented 2023-09-08 07:40:07 +00:00

While also exposing the previous padding was not perfect

While also exposing the previous padding was not perfect
jarolrod (Migrated from github.com) reviewed 2023-09-12 03:28:00 +00:00
jarolrod (Migrated from github.com) commented 2023-09-11 05:19:53 +00:00
// Copyright (c) 2023 The Bitcoin Core developers
```suggestion // Copyright (c) 2023 The Bitcoin Core developers ```
jarolrod (Migrated from github.com) commented 2023-09-11 23:42:40 +00:00

Should add to keep proper padding

diff --git a/src/qml/controls/NavigationBar2.qml b/src/qml/controls/NavigationBar2.qml
index 1d523bcbd..5d15bb319 100644
--- a/src/qml/controls/NavigationBar2.qml
+++ b/src/qml/controls/NavigationBar2.qml
@@ -16,6 +16,8 @@ Pane {
     contentItem: RowLayout {
         Div {
             id: left_div
+            Layout.topMargin: 4
+            Layout.leftMargin: 4
             Layout.preferredWidth: Math.floor(Math.max(left_div.implicitWidth, right_div.implicitWidth))
             contentItem: RowLayout {
                 Section {
@@ -27,9 +29,12 @@ Pane {
         }
         Section {
             id: center_section
+            Layout.topMargin: 4
         }
         Div {
             id: right_div
+            Layout.topMargin: 4
+            Layout.rightMargin: 4
             Layout.preferredWidth: Math.floor(Math.max(left_div.implicitWidth, right_div.implicitWidth))
             contentItem: RowLayout {
                 Spacer {
Should add to keep proper padding ```diff diff --git a/src/qml/controls/NavigationBar2.qml b/src/qml/controls/NavigationBar2.qml index 1d523bcbd..5d15bb319 100644 --- a/src/qml/controls/NavigationBar2.qml +++ b/src/qml/controls/NavigationBar2.qml @@ -16,6 +16,8 @@ Pane { contentItem: RowLayout { Div { id: left_div + Layout.topMargin: 4 + Layout.leftMargin: 4 Layout.preferredWidth: Math.floor(Math.max(left_div.implicitWidth, right_div.implicitWidth)) contentItem: RowLayout { Section { @@ -27,9 +29,12 @@ Pane { } Section { id: center_section + Layout.topMargin: 4 } Div { id: right_div + Layout.topMargin: 4 + Layout.rightMargin: 4 Layout.preferredWidth: Math.floor(Math.max(left_div.implicitWidth, right_div.implicitWidth)) contentItem: RowLayout { Spacer { ```
jarolrod (Migrated from github.com) commented 2023-09-11 05:30:06 +00:00

nice, we should do this more often. Having helper components.

nice, we should do this more often. Having helper components.
jarolrod (Migrated from github.com) commented 2023-09-11 08:10:29 +00:00

+1 for navbar2, this can be defined when defining the page, instead of defining the navbar components where the Peers page is to be used.

+1 for navbar2, this can be defined when defining the page, instead of defining the navbar components where the Peers page is to be used.
promag (Migrated from github.com) reviewed 2023-09-12 20:53:57 +00:00
promag (Migrated from github.com) commented 2023-09-12 20:53:57 +00:00

Set padding to 4 instead.

Set padding to 4 instead.
promag (Migrated from github.com) reviewed 2023-09-12 20:55:38 +00:00
promag (Migrated from github.com) commented 2023-09-12 20:55:38 +00:00

Not sure what is the suggestion.

Not sure what is the suggestion.
jarolrod (Migrated from github.com) reviewed 2023-09-12 21:12:33 +00:00
jarolrod (Migrated from github.com) commented 2023-09-12 21:12:33 +00:00

There is no suggestion, just a comment on what I like about this :)

There is no suggestion, just a comment on what I like about this :)
jarolrod (Migrated from github.com) approved these changes 2023-11-10 03:39:28 +00:00
jarolrod (Migrated from github.com) left a comment

tACK b5b73b010b

This is an improvement over using loaders in the original NavigationBar, and sets a foundation for where the navbar needs to go. Last place that still uses the original navbar is InformationPage, but this requires more reworking and the work needed can change depending on when we move to a UI flow of stack views.

tACK b5b73b010b05a2f125d722f85de3bb0779d3df2d This is an improvement over using loaders in the original NavigationBar, and sets a foundation for where the navbar needs to go. Last place that still uses the original navbar is InformationPage, but this requires more reworking and the work needed can change depending on when we move to a UI flow of stack views.
Sign in to join this conversation.
No description provided.