Skip to content

Conversation

@shaavan
Copy link
Contributor

@shaavan shaavan commented Oct 25, 2021

Till now, peerTable and banTable under the peerTab were fixed in height and cannot be resized. This creates unnecessary inconvenience, especially when you have many items on one table and not many on another.

This PR proposes to add a splitter between these two tables, allowing them to be resized freely.

Master PR
Screenshot from 2021-10-25 21-26-09 Screenshot from 2021-11-01 17-43-01

@Saibato
Copy link
Contributor

Saibato commented Oct 26, 2021

concept ACK

I like the resize. Are they connected or active traffic?

@shaavan
Copy link
Contributor Author

shaavan commented Oct 27, 2021

Are they connected or active traffic?

I think they both mean the same thing in this context.
Connected peers, implies the peer that we are currently connected to, indicating the active traffic.

Copy link
Contributor

@jarolrod jarolrod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't display until there is a Banned Peers table
Screen Shot 2021-10-27 at 9 39 36 PM

Additionally, I shouldn't be able to hide any of the tables

Screen Shot 2021-10-27 at 9 39 41 PM

Copy link
Member

@luke-jr luke-jr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new label is redundant: the tab name itself indicates what the user is viewing.

Concept ACK to adding a splitter.

@shaavan shaavan force-pushed the peer-table-splitter branch from 5e54cfe to c09e6ad Compare November 1, 2021 12:31
@shaavan
Copy link
Contributor Author

shaavan commented Nov 1, 2021

Updated 5e54cfe to c09e6ad (pr457.01 -> pr457.02)
Addressed @jarolrod comments

Updates:

  1. Considering that naming peerTable was not gathering a lot of support. I have removed that change from this PR.
  2. Made the peerTable and banTable non-collapsible.
  3. Increased splitter’s height from 3px to 4px.

This shouldn't display until there is a Banned Peers table

@jarolrod. As you rightly mentioned, showing splitter when no BanTable was looking kind of off. But in the new iteration of this PR, the splitter seems like an element of peerTable and looks aesthetically pleasing even when there is no banTable. I have updated the PR description with the new Screenshots. You can look at them to better get the feel of what I am trying to say.

Copy link
Contributor

@jarolrod jarolrod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Getting there, but the splitter should behave like the splitter that currently exists between the Peers Table and the Peer Information Pane.

When I select a Peer, I get the Peer Information Pane, as well as a splitter where I can resize as needed. When the peer is de-selected, the splitter disappears; because there is nothing to resize.

Similarly, until I have a banned peer and a banned peer table, the splitter being introduced here should not be displayed at all because there is nothing to resize. Additionally, if i unban a peer and subsequently no longer have a banned peers table, the splitter should disappear as well.

@shaavan shaavan force-pushed the peer-table-splitter branch from c09e6ad to aa6229e Compare November 3, 2021 13:45
@shaavan
Copy link
Contributor Author

shaavan commented Nov 3, 2021

Updated from c09e6ad to aa6229e (pr457.02 -> pr457.03, diff)
Addressed @jarolrod comments

Changes:

  • Instead of hiding individual children of banTable. The code is now updated to hide the banTable widget. This will make sure the splitter will not be displayed when there is no banTable.
  • Updated sizePolicy to better reflect the peerWidget and the banTable widget.
  • Added code to save and restore the state (position) of the splitter. The state is remembered even in the case when GUI is shut down and restarted.

@shaavan
Copy link
Contributor Author

shaavan commented Nov 5, 2021

cc @jarolrod. PR ready for another review!

Copy link
Contributor

@kristapsk kristapsk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK aa6229e (tested under Linux / Xfce4)

Copy link
Contributor

@promag promag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concept ACK.

<set>Qt::NoTextInteraction</set>
<widget class="QSplitter" name="tableSplitter">
<property name="styleSheet">
<string notr="true">QSplitter::handle{background: #a6a6a6;}</string>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this style?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did this to make the splitter visible and looks aesthetically pleasing.
Do you recommend keeping the splitter invisible?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about this? @promag

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you recommend keeping the splitter invisible?

I don't think the hardcoded color will work for any platform and appearance (dark/light), no?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the hardcoded color will work for any platform and appearance (dark/light), no?

The spiller looks fine for the default light mode (in Linux) and dark mode in macOS, which can be seen in the screenshots of the following comments: light; dark.

However, this doesn't guarantee that this will work for any custom appearance. Do you recommend removing the hardcoded color and making the splitter invisible again?

Copy link
Member

@hebasto hebasto Dec 27, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not keeping the same look as for the horizontal splitter?

Do you recommend keeping the splitter invisible?

What does make you think so?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you recommend keeping the splitter invisible?

By this, I meant to say, keeping it the same as the horizontal splitter.

Why not keep the same look as for horizontal splitter?

I think this will be a more optimal approach to go with.

Copy link
Member

@hebasto hebasto Dec 27, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But the horizontal splitter is not invisible :)

DeepinScreenshot_select-area_20211227131731

And having different looks for similar GUI elements does not as an optimal design for me.

Copy link
Member

@hebasto hebasto Dec 27, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At least, introducing a new GUI element, and changing GUI element style across the GUI are two different tasks.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed splitter color to default palette in 0c36420

Copy link
Contributor

@w0xlt w0xlt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tACK aa6229e . Tested on Ubuntu 21.10.

@hebasto hebasto added the UI All about "look and feel" label Nov 21, 2021
@hebasto
Copy link
Member

hebasto commented Nov 21, 2021

Concept ACK.

@hebasto hebasto changed the title qt: Add abitlity to resize peerTable and banTable Add abitlity to resize peerTable and banTable Dec 14, 2021
Comment on lines 757 to 759
//Setup Peer and Ban Table Splitter
ui->tableSplitter->setChildrenCollapsible(false);

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code could be a part of the debugwindow.ui file as it is for the horizontal splitter.

Qt Designer tool could very helpful for such tasks.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 0c36420

<number>0</number>
<number>3</number>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was an auto-generated change by QtCreator. Fixed in 0c36420

@DrahtBot DrahtBot mentioned this pull request Dec 30, 2021
@DrahtBot
Copy link
Contributor

DrahtBot commented Dec 30, 2021

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #540 (network graph - show/hide panels based on window width/height by RandyMcMillan)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@shaavan shaavan force-pushed the peer-table-splitter branch from aa6229e to 0c36420 Compare January 7, 2022 18:25
@shaavan
Copy link
Contributor Author

shaavan commented Jan 7, 2022

Updated from aa6229e to 0c36420(pr457.04 -> pr457.05)
Addressed @hebasto and @randymacmilan comments

  • Removed custom color of the added splitter
  • Moved childrenCollapsible=False to debugwindow.ui file.
  • Removed auto-generated changes by QtCreator.

Copy link
Member

@hebasto hebasto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approach ACK 0c36420.

Could you please separate a refactoring commit which introduces the banTable widget?

</size>
</property>
<layout class="QVBoxLayout" name="verticalLayout_7">
<layout class="QVBoxLayout" name="verticalLayout_9">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this change required?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this PR introduced a new sub-Layout, the introduced sub-Layout was named in the chronological order of its introduction. And since verticalLayout_7 already exists (on Line 935), giving this the same name leads to a warning message while compiling:

qt/forms/debugwindow.ui: Warning: The name 'verticalLayout_7' (QVBoxLayout) is already in use, defaulting to 'verticalLayout_71'.

So, I am letting this change be as it is for now, and I welcome any suggestions you might have.

shaavan added 2 commits July 2, 2022 18:19
- This is a pure refactoring change and is done so that the table
  splitter can be added between peerTable and banTable in the following
commit.
This commit adds a splitter between the peerWidget and the
banTable widget. This adds the ability to resize these windows
to the user’s needs.
@shaavan shaavan force-pushed the peer-table-splitter branch from 0c36420 to 5a9bdce Compare July 2, 2022 13:24
@shaavan
Copy link
Contributor Author

shaavan commented Jul 2, 2022

Updated from 0c36420 to 5a9bdce (pr457.05 -> pr457.06, diff)

Addressed @hebasto comment

Changes:

  • Rebased PR over the current master.
  • Separated adding of banTable and tableSplitter in separate commits.
  • Removed unnecessary width/height changes.

Copy link
Contributor

@jarolrod jarolrod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While the resizing works, the UI here does not. The UI element representing the splitter is too small and is pinned to the bottom of peerTable.

linux macOS
Screenshot from 2022-08-06 18-41-26 Screen Shot 2022-08-06 at 6 49 31 PM

@hebasto
Copy link
Member

hebasto commented Oct 26, 2022

Closing this as it has not had any activity in a while. If you are interested in continuing work on this, please leave a comment so that it can be reopened.

@hebasto hebasto closed this Oct 26, 2022
@bitcoin-core bitcoin-core locked and limited conversation to collaborators Oct 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Feature UI All about "look and feel"

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants