Skip to content

Add icon picker for floating window triggers and increase label font size#19

Open
Programmer-MrWang wants to merge 1 commit intomainfrom
codex/update
Open

Add icon picker for floating window triggers and increase label font size#19
Programmer-MrWang wants to merge 1 commit intomainfrom
codex/update

Conversation

@Programmer-MrWang
Copy link
Owner

Motivation

  • Provide a visual icon picker to make it easier to choose and preview icons for floating window buttons.
  • Improve the layout and usability of the floating trigger settings panel by adding a two-column grid and a dedicated drawer for icon selection.
  • Improve label readability in the floating window by increasing the button name font size.

Description

  • Increased the floating-window button name font size from 10 to 12 in Services/FloatingWindowService.cs to improve readability.
  • Reworked Settings/FloatingWindowTriggerSettings.cs to replace the simple stack layout with a two-column Grid and added an icon drawer panel built by BuildIconDrawer() that contains a virtualized ListBox of icon rows.
  • Implemented an icon picker flow with OpenIconDrawer(), CloseIconDrawer(), SelectIcon(string), LoadIconRows(), and UI helpers BuildRowPanel(IconRow) and BuildIconDrawer(), plus the IconItem and IconRow records to represent available icons and rows.
  • Added constants IconCodeStart, IconCodeEnd, and IconsPerRow and wired the icon TextBox and a new "选择图标" button to update Settings.Icon immediately on selection.

Testing

  • No automated tests were added for the new UI functionality.
  • No automated test suite was run as part of this change.

Codex Task

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 024ebe8cc1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

var panel = new StackPanel { Spacing = 10, Margin = new(10) };
_rootGrid = new Grid
{
ColumnDefinitions = new ColumnDefinitions("*,420"),

Choose a reason for hiding this comment

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

P2 Badge Collapse icon-drawer column when drawer is closed

The grid reserves a fixed 420-pixel second column regardless of whether _iconDrawer is visible, so closing the drawer only hides its content and still permanently shrinks the main settings form. In narrower settings hosts this can make the editable fields feel cramped or clipped even before the user opens the picker; the column width should be toggled with drawer state (or use Auto/splitter behavior) instead of staying fixed.

Useful? React with 👍 / 👎.

Comment on lines +125 to +127
var drawerContent = new StackPanel
{
Children =

Choose a reason for hiding this comment

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

P2 Badge Constrain icon list viewport to preserve virtualization

Placing the icon ListBox inside a vertical StackPanel gives it effectively unbounded height during measure, which can defeat list virtualization and force creation of the full icon grid when the drawer opens. Given LoadIconRows() builds hundreds of rows from the 0xE000..0xF4D3 range, this can cause a noticeable UI stall; use a layout that constrains the list (for example a Grid row with * height or explicit max height) so virtualization can work.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant