Skip to content
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

fix: improve folder list UI appearance #2483

Merged
merged 3 commits into from
Dec 10, 2024

Conversation

Lighto-Ku
Copy link
Contributor

  • Add Qt::FramelessWindowHint to folder list window for better visual style
  • Unify margin constant naming to kFolderListItemMargin
  • Simplify folder list height calculation logic
  • Use system style radius for folder item highlight through DStyle

Log: fix UI issue
Bug: https://pms.uniontech.com/bug-view-289873.html

- Add Qt::FramelessWindowHint to folder list window for better visual style
- Unify margin constant naming to kFolderListItemMargin
- Simplify folder list height calculation logic
- Use system style radius for folder item highlight through DStyle

Log: fix UI issue
Bug: https://pms.uniontech.com/bug-view-289873.html
1. Add expanded item animation in ViewAnimationHelper
2. Add expandedItem() interface in BaseItemDelegate
3. Implement expandedItem() in IconItemDelegate
4. Add support for painting expanded item with offset and animation

This change improves the visual experience when expanding items in file view
by adding smooth animation effects.

Log: fix view animation issue
Bug: https://pms.uniontech.com/bug-view-291249.html
1. Add kTabMaxWidth constant to limit maximum tab width to 240px
2. Replace hardcoded tab width limit (120px) with kTabMaxWidth constant
3. Apply the limit to both average width and last tab width calculations

This change prevents tabs from becoming too wide when there are few tabs,
improving the overall layout consistency of the tab bar.

Log: fix tab issue
Bug: https://pms.uniontech.com/bug-view-292487.html
@deepin-ci-robot
Copy link

deepin pr auto review

代码审查意见:

  1. folderlistwidget.cpp文件中,将kItemMargin替换为kFolderListItemMargin是一个好的做法,确保了命名的一致性,有助于代码的可读性和维护性。

  2. folderlistwidget.cpp文件中,setWindowFlag(Qt::Popup)被替换为setWindowFlags(Qt::Popup | Qt::FramelessWindowHint),这是一个合理的改动,因为它增加了窗口的无边框特性,可能符合UI设计的要求。

  3. folderviewdelegate.cpp文件中,添加了对DStyle的引用,这是一个好的做法,因为它允许使用主题相关的样式,提高了代码的灵活性和可维护性。

  4. folderviewdelegate.cpp文件中,paint函数中使用了DStyle::pixelMetric来获取窗口的圆角半径,这是一个好的做法,因为它使得圆角半径可以根据主题样式动态变化。

  5. tabbar.cpp文件中,tabSizeHint函数中添加了对kTabMaxWidth的引用,这是一个好的做法,它限制了标签的最大宽度,有助于保持界面的整洁和一致性。

  6. viewanimationhelper.cpp文件中,添加了对itemdelegatehelper.h的引用,这是一个好的做法,因为它可能需要使用到ItemDelegateHelper类中的功能。

  7. viewanimationhelper.cpp文件中,paintItems函数中添加了对expandItemRect的计算,这是一个好的做法,它使得展开项的绘制更加精确。

  8. viewanimationhelper.cpp文件中,resetExpandItem函数的实现看起来是合理的,它根据展开项的有效性来设置expandItemIndexexpandItemPixmapexpandItemOffset,这是一个好的做法,它确保了展开项的正确绘制。

  9. baseitemdelegate.cpp文件中,添加了expandedItem函数的实现,这是一个好的做法,它使得子类可以提供自己的展开项实现。

  10. baseitemdelegate.h文件中,添加了expandedItem函数的声明,这是一个好的做法,它使得子类可以提供自己的展开项实现。

  11. iconitemdelegate.cpp文件中,添加了expandedItem函数的实现,这是一个好的做法,它使得子类可以提供自己的展开项实现。

  12. iconitemdelegate.h文件中,添加了expandedItem函数的声明,这是一个好的做法,它使得子类可以提供自己的展开项实现。

总体来说,这些改动都是合理的,它们提高了代码的可读性、可维护性和灵活性。

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Johnson-zs, Lighto-Ku

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@Johnson-zs
Copy link
Contributor

/merge

@deepin-bot deepin-bot bot merged commit 4dc4b6d into linuxdeepin:master Dec 10, 2024
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants