Add abitlity to resize peerTable and banTable #457

pull shaavan wants to merge 2 commits into bitcoin-core:master from shaavan:peer-table-splitter changing 2 files +111 −81
  1. shaavan commented at 6:17 pm on October 25, 2021: contributor

    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
  2. jarolrod added the label Feature on Oct 26, 2021
  3. Saibato commented at 5:53 pm on October 26, 2021: contributor

    concept ACK

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

  4. shaavan commented at 11:59 am on October 27, 2021: contributor

    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.

  5. in src/qt/forms/debugwindow.ui:907 in 5e54cfec82 outdated
    977+             <widget class="QWidget" name="peerTable" native="true">
    978+              <layout class="QVBoxLayout" name="verticalLayout_9">
    979+               <item>
    980+                <widget class="QLabel" name="peerHeading_2">
    981+                 <property name="text">
    982+                  <string>Connected peers</string>
    


    jarolrod commented at 1:43 am on October 28, 2021:

    I’m not sure about this.

    In any case, I don’t think this should be a part of this PR considering the title suggests you want to just add functionality to resize tabled


    shaavan commented at 8:30 am on November 1, 2021:

    This shouldn’t display until there is a Banned Peers table Additionally, I shouldn’t be able to hide any of the tables

    These are valid suggestions. Let me take a look into implementing these.

    I don’t think this should be a part of this PR considering the title suggests you want to just add functionality to resize tabled

    Ok then, I shall remove the name change from this PR and may open it as another pull request in the future (if need be)

  6. jarolrod commented at 1:43 am on October 28, 2021: member

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

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

  7. luke-jr changes_requested
  8. luke-jr commented at 5:28 pm on October 29, 2021: member

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

    Concept ACK to adding a splitter.

  9. shaavan force-pushed on Nov 1, 2021
  10. shaavan commented at 12:32 pm on November 1, 2021: contributor

    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.

  11. jarolrod commented at 4:28 am on November 2, 2021: member

    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.

  12. shaavan force-pushed on Nov 3, 2021
  13. shaavan commented at 1:45 pm on November 3, 2021: contributor

    Updated from c09e6ad39da24a7a969533f6ce5c9cea14e8c9ce to aa6229e5d2bebe20d3e8e3eded8ff3ad7841bfcb (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.
  14. shaavan commented at 3:30 am on November 5, 2021: contributor
    cc @jarolrod. PR ready for another review!
  15. in src/qt/forms/debugwindow.ui:10 in aa6229e5d2 outdated
     5@@ -6,13 +6,16 @@
     6    <rect>
     7     <x>0</x>
     8     <y>0</y>
     9-    <width>740</width>
    10-    <height>430</height>
    11+    <width>744</width>
    12+    <height>531</height>
    


    kristapsk commented at 2:33 pm on November 9, 2021:
    Why this change?

    shaavan commented at 1:44 pm on November 10, 2021:
    I am not sure of the reason. But I observed they are set to these values (744, 531) each time debugwindow.ui is opened in QTCreator even if we try to change them. However, this does not cause any functional change.

    kristapsk commented at 3:34 pm on November 10, 2021:
    Ok, then seems reasonable to change to these values.

    RandyMcMillan commented at 2:54 pm on December 13, 2021:
    We manually edit these values to remove this diff junk - this way it stays consistent.

    RandyMcMillan commented at 2:59 pm on December 13, 2021:
    Including - resetting the currentIndex to zero (below)

    shaavan commented at 6:29 pm on January 7, 2022:
    Resetted these changes to the master’s value in 0c364201a2e16355cd6424c6137761c7967db4e0
  16. kristapsk approved
  17. kristapsk commented at 3:35 pm on November 10, 2021: contributor
    ACK aa6229e5d2bebe20d3e8e3eded8ff3ad7841bfcb (tested under Linux / Xfce4)
  18. in src/qt/forms/debugwindow.ui:897 in aa6229e5d2 outdated
    953-             </property>
    954-             <property name="textInteractionFlags">
    955-              <set>Qt::NoTextInteraction</set>
    956+            <widget class="QSplitter" name="tableSplitter">
    957+             <property name="styleSheet">
    958+              <string notr="true">QSplitter::handle{background: #a6a6a6;}</string>
    


    promag commented at 6:09 pm on November 11, 2021:
    Why this style?

    shaavan commented at 7:49 am on November 13, 2021:
    I did this to make the splitter visible and looks aesthetically pleasing. Do you recommend keeping the splitter invisible?

    shaavan commented at 2:27 pm on November 17, 2021:
    What do you think about this? @promag

    hebasto commented at 9:06 pm on November 21, 2021:

    Do you recommend keeping the splitter invisible?

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


    shaavan commented at 11:09 am on November 22, 2021:

    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?


    hebasto commented at 11:06 am on December 27, 2021:

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

    Do you recommend keeping the splitter invisible?

    What does make you think so?


    shaavan commented at 11:11 am on December 27, 2021:

    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.


    hebasto commented at 11:14 am on December 27, 2021:

    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.


    hebasto commented at 11:16 am on December 27, 2021:
    At least, introducing a new GUI element, and changing GUI element style across the GUI are two different tasks.

    shaavan commented at 6:29 pm on January 7, 2022:
    Fixed splitter color to default palette in 0c364201a2e16355cd6424c6137761c7967db4e0
  19. promag commented at 6:10 pm on November 11, 2021: contributor
    Concept ACK.
  20. w0xlt approved
  21. w0xlt commented at 1:41 pm on November 15, 2021: contributor
    tACK aa6229e . Tested on Ubuntu 21.10.
  22. hebasto added the label UI on Nov 21, 2021
  23. hebasto commented at 9:04 pm on November 21, 2021: member
    Concept ACK.
  24. hebasto renamed this:
    qt: Add abitlity to resize peerTable and banTable
    Add abitlity to resize peerTable and banTable
    on Dec 14, 2021
  25. in src/qt/rpcconsole.cpp:759 in aa6229e5d2 outdated
    753@@ -750,6 +754,9 @@ void RPCConsole::setClientModel(ClientModel *model, int bestblock_height, int64_
    754         ui->startupTime->setText(model->formatClientStartupTime());
    755         ui->networkName->setText(QString::fromStdString(Params().NetworkIDString()));
    756 
    757+        //Setup Peer and Ban Table Splitter
    758+        ui->tableSplitter->setChildrenCollapsible(false);
    759+
    


    hebasto commented at 11:09 am on December 27, 2021:

    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.


    shaavan commented at 6:28 pm on January 7, 2022:
    Addressed in 0c364201a2e16355cd6424c6137761c7967db4e0
  26. in src/qt/forms/debugwindow.ui:39 in aa6229e5d2 outdated
    38@@ -36,7 +39,7 @@
    39    <item>
    40     <widget class="QTabWidget" name="tabWidget">
    41      <property name="currentIndex">
    42-      <number>0</number>
    43+      <number>3</number>
    


    hebasto commented at 11:09 am on December 27, 2021:
    Why this change?

    shaavan commented at 6:28 pm on January 7, 2022:
    This was an auto-generated change by QtCreator. Fixed in 0c364201a2e16355cd6424c6137761c7967db4e0
  27. DrahtBot cross-referenced this on Dec 30, 2021 from issue Hide Peers Detail Button by RandyMcMillan
  28. DrahtBot commented at 10:53 am on December 30, 2021: contributor

    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.

  29. shaavan force-pushed on Jan 7, 2022
  30. shaavan commented at 6:27 pm on January 7, 2022: contributor

    Updated from aa6229e5d2bebe20d3e8e3eded8ff3ad7841bfcb to 0c364201a2e16355cd6424c6137761c7967db4e0(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.
  31. in src/qt/forms/debugwindow.ui:890 in 0c364201a2 outdated
    886@@ -887,85 +887,112 @@
    887             <height>0</height>
    888            </size>
    889           </property>
    890-          <layout class="QVBoxLayout" name="verticalLayout_7">
    891+          <layout class="QVBoxLayout" name="verticalLayout_9">
    


    hebasto commented at 6:16 pm on June 26, 2022:
    Is this change required?

    shaavan commented at 12:25 pm on July 2, 2022:

    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:

    0qt/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.

  32. hebasto commented at 6:19 pm on June 26, 2022: member

    Approach ACK 0c364201a2e16355cd6424c6137761c7967db4e0.

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

  33. qt, refactor: Group banHeading and banlistWidget in debugwindow.ui
    - 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.
    4b9f3492b0
  34. qt: Add ability to resize Peer and Ban table
    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.
    5a9bdce0ad
  35. shaavan force-pushed on Jul 2, 2022
  36. shaavan commented at 1:24 pm on July 2, 2022: contributor

    Updated from 0c364201a2e16355cd6424c6137761c7967db4e0 to 5a9bdce0ad753919522b8bc627c1c12d92d7cae8 (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.
  37. DrahtBot cross-referenced this on Jul 3, 2022 from issue network graph - show/hide panels based on window width/height by RandyMcMillan
  38. jarolrod commented at 10:55 pm on August 6, 2022: member

    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
  39. hebasto commented at 3:54 pm on October 26, 2022: member
    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.
  40. hebasto closed this on Oct 26, 2022

  41. bitcoin-core locked this on Oct 26, 2023

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/gui. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-11-23 09:20 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me