-
Notifications
You must be signed in to change notification settings - Fork 266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
qt: peers-tab resizeColumnsToContents #338
Conversation
Related to #256 This PR handles resizing column widths programmatically. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm failing to understand what this is trying to address, can you clarify a bit? 🤔
@@ -120,6 +122,8 @@ QVariant BanTableModel::data(const QModelIndex &index, int role) const | |||
const auto column = static_cast<ColumnIndex>(index.column()); | |||
if (role == Qt::DisplayRole) { | |||
switch (column) { | |||
case Bumper: | |||
return QString::fromStdString(""); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why does this need to be QString::fromStdString("")
return {}; | ||
} // no default case, so the compiler can warn about missing cases | ||
case Subversion: | ||
return QVariant(Qt::AlignLeft | Qt::AlignVCenter); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't this unrelated to what you want to do?
@@ -38,6 +38,8 @@ bool PeerTableSortProxy::lessThan(const QModelIndex& left_index, const QModelInd | |||
return left_stats.nRecvBytes < right_stats.nRecvBytes; | |||
case PeerTableModel::Subversion: | |||
return left_stats.cleanSubVer.compare(right_stats.cleanSubVer) < 0; | |||
case PeerTableModel::Bumper: | |||
return left_stats.nodeid < right_stats.nodeid; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this sorting scheme?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorting by nodeid
was simply to have sorting functionality for that column as opposed to no sorting functionality.
Goal of this PR/Discussion
Motivations for /gui fork as far as I can tell...
|
Concept NACK. There are some concerns about
Usually, in this project, we strive do not make decisions instead of users in such questions :)
|
Concept NACK This unnecessarily restricts the user-configurability of the GUI. Testing this PR, I am no longer able to resize the tabs on my own to my liking. Per Qt docs, this is because of the use of QHeaderView::ResizeToContents. In general, we should ONLY restrict user freedom when there is good reason and motivation to do so. Tables are meant to be resized to one's liking; not everyone wants to see the Users of the GUI do want to customize the sizing of various aspects of the interface and have that saved and restored. This is a precedent that has been set by the direction GUI development has taken, See #165, #194, #205, and #256. |
🐙 This pull request conflicts with the target branch and needs rebase. Want to unsubscribe from rebase notifications on this pull request? Just convert this pull request to a "draft". |
Can we make it do this only until the user tries to manually resize a column? |
No description provided.