Fix: Network panel input field in the taskbar is not within the visib…#545
Merged
deepin-bot[bot] merged 2 commits intolinuxdeepin:masterfrom Apr 9, 2026
Merged
Fix: Network panel input field in the taskbar is not within the visib…#545deepin-bot[bot] merged 2 commits intolinuxdeepin:masterfrom
deepin-bot[bot] merged 2 commits intolinuxdeepin:masterfrom
Conversation
…le area. Log: sizeHint always returns a fixed row height (30–36px). After the password input field is dynamically added via addPasswordWidget, the row height does not expand to match the actual height of the editor, causing the password area to be clipped and hidden by the QTreeView. Additionally, updateLayout skips calling updateGeometries when the panel is visible, preventing the row height from being refreshed in time. The fix ensures that sizeHint checks the actual editor height and uses the larger value, and removes the isVisible() condition in updateLayout so that updateGeometries is always invoked. PMS: bug-336757
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdjusts the network panel’s item sizing and layout updates so that dynamically added password input fields are fully visible instead of being clipped by the QTreeView. Sequence diagram for layout update when password editor is shownsequenceDiagram
actor User
participant NetView
participant QTreeView
participant NetDelegate
participant PasswordEditor
User ->> NetView: onActivated(index)
NetView ->> QTreeView: setIndexWidget(index, PasswordEditor)
QTreeView ->> NetDelegate: createEditor(parent, option, index)
NetDelegate ->> PasswordEditor: construct password input
User ->> NetView: onExpandStatusChanged()
NetView ->> NetView: updateLayout()
NetView ->> QTreeView: scheduleDelayedItemsLayout()
NetView ->> QTreeView: updateGeometries()
QTreeView ->> NetDelegate: sizeHint(option, index)
NetDelegate ->> QTreeView: editor = m_view.indexWidget(index)
NetDelegate ->> PasswordEditor: editor.sizeHint()
PasswordEditor -->> NetDelegate: editorHeight
NetDelegate -->> QTreeView: max(defaultRowHeight, editorHeight)
QTreeView ->> QTreeView: layout rows using updated height
QTreeView ->> User: password editor fully visible
Class diagram for updated NetDelegate and NetView sizing behaviorclassDiagram
class NetDelegate {
- QTreeView* m_view
+ QWidget* createEditor(QWidget* parent, QStyleOptionViewItem& option, QModelIndex& index)
+ QSize sizeHint(QStyleOptionViewItem& option, QModelIndex& index) const
+ void updateEditorGeometry(QWidget* editor, QStyleOptionViewItem& option, QModelIndex& index) const
}
class NetView {
+ void onActivated(QModelIndex& index)
+ void updateLayout()
+ void onExpandStatusChanged()
+ void scheduleDelayedItemsLayout()
+ void updateGeometries()
}
class QTreeView {
+ QWidget* indexWidget(QModelIndex& index) const
+ void scheduleDelayedItemsLayout()
+ void updateGeometries()
+ QSize sizeHintForIndex(QModelIndex& index) const
}
NetDelegate --> QTreeView : uses m_view
NetView --> QTreeView : manages layout
QTreeView --> NetDelegate : queries sizeHint
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- In
sizeHint, when using the editor’ssizeHint().height()you overwrite the padding-calculated height; consider addingtop/bottomspacing to the editor height so the expanded row still respects the intended vertical margins. - Calling
updateGeometries()unconditionally inupdateLayout()may introduce extra layout work when the view is already up to date; it’s worth double-checking whether a cheaper condition (e.g., checking for pending geometry updates rather than visibility) could avoid unnecessary recalculations.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `sizeHint`, when using the editor’s `sizeHint().height()` you overwrite the padding-calculated height; consider adding `top`/`bottom` spacing to the editor height so the expanded row still respects the intended vertical margins.
- Calling `updateGeometries()` unconditionally in `updateLayout()` may introduce extra layout work when the view is already up to date; it’s worth double-checking whether a cheaper condition (e.g., checking for pending geometry updates rather than visibility) could avoid unnecessary recalculations.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
18202781743
approved these changes
Apr 9, 2026
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, JWWTSL The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Contributor
Author
|
/forcemerge |
Contributor
|
This pr force merged! (status: unstable) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Log: sizeHint always returns a fixed row height (30–36px). After the password input field is dynamically added via addPasswordWidget, the row height does not expand to match the actual height of the editor, causing the password area to be clipped and hidden by the QTreeView. Additionally, updateLayout skips calling updateGeometries when the panel is visible, preventing the row height from being refreshed in time. The fix ensures that sizeHint checks the actual editor height and uses the larger value, and removes the isVisible() condition in updateLayout so that updateGeometries is always invoked.
PMS: bug-336757