Enhance ColorSplasher functionality and localization#3005
Enhance ColorSplasher functionality and localization#3005
Conversation
- Refactored ColorSplasher UI to improve user experience with localized strings for category and parameter selection. - Updated event handling for selection changes and color application, ensuring robust error handling and logging. - Improved data binding for list boxes and added placeholder items for better guidance. - Enhanced color selection and gradient application features, ensuring compatibility with WPF elements. - Fixed visibility settings and task dialog messages to reflect localized content accurately.
…asher - Introduced a new placeholder string for selecting a category and parameter across multiple language resource files (Chinese, German, English, Spanish, French, and Russian). - Updated the ColorSplasher UI to display the placeholder text when the corresponding list box is empty, enhancing user guidance and experience.
- Adjusted margins and heights of various UI elements in ColorSplasherWindow.xaml to enhance visual alignment and user experience. - Standardized button heights and margins for a more cohesive look across the interface.
- Adjusted the margin of the search TextBox to improve layout consistency and visual alignment within the ColorSplasher UI.
- Introduced new buttons for selecting all elements and clearing selections in the ColorSplasher UI, enhancing user interaction. - Updated localization files to include translations for the new buttons and tooltips in English, French, and Russian. - Improved event handling to capture Shift key state for multi-selection, ensuring a more intuitive user experience.
- Simplified data access methods in ColorSplasherWindow to enhance clarity and reduce redundancy. - Removed unnecessary comments and improved existing ones for better understanding of the code flow. - Streamlined event handling and UI updates to ensure a more efficient user experience. - Enhanced error handling during data access to prevent potential crashes and improve logging.
There was a problem hiding this comment.
Pull request overview
This pull request migrates the ColorSplasher tool from Windows Forms to WPF, adds comprehensive localization support for multiple languages (English, Spanish, French, German, Russian, and Chinese), and introduces new features including element selection via Shift+Click and Select All/None buttons. The refactoring improves user experience with better UI organization, placeholder text, and robust error handling.
Changes:
- Migrated UI from WinForms to WPF with XAML-based layout
- Added localization support with ResourceDictionary files for 6 languages
- Implemented new element selection features (Shift+Click, Select All/None buttons)
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| script.py | Refactored from WinForms to WPF; updated event handlers from SelectedIndexChanged to SelectionChanged; replaced DataSource/DisplayMember with ItemsSource; changed property access from Checked/Visible to IsChecked/Visibility; added localization support and new selection features |
| ColorSplasherWindow.xaml | New WPF window definition with grid-based layout, dynamic resource bindings for localization, and structured UI organization |
| ColorSplasherWindow.ResourceDictionary.en_us.xaml | English localization strings for all UI elements, messages, tooltips, and dialog text |
| ColorSplasherWindow.ResourceDictionary.ru.xaml | Russian localization strings (complete) |
| ColorSplasherWindow.ResourceDictionary.fr_fr.xaml | French localization strings (complete) |
| ColorSplasherWindow.ResourceDictionary.es_es.xaml | Spanish localization strings (missing Select All/None translations) |
| ColorSplasherWindow.ResourceDictionary.de_de.xaml | German localization strings (missing Select All/None translations) |
| ColorSplasherWindow.ResourceDictionary.chinese_s.xaml | Chinese (Simplified) localization strings (missing Select All/None translations) |
...ab/Analysis.panel/ColorSplasher.pushbutton/ColorSplasherWindow.ResourceDictionary.es_es.xaml
Show resolved
Hide resolved
...ab/Analysis.panel/ColorSplasher.pushbutton/ColorSplasherWindow.ResourceDictionary.de_de.xaml
Show resolved
Hide resolved
...nalysis.panel/ColorSplasher.pushbutton/ColorSplasherWindow.ResourceDictionary.chinese_s.xaml
Show resolved
Hide resolved
extensions/pyRevitTools.extension/pyRevit.tab/Analysis.panel/ColorSplasher.pushbutton/script.py
Outdated
Show resolved
Hide resolved
extensions/pyRevitTools.extension/pyRevit.tab/Analysis.panel/ColorSplasher.pushbutton/script.py
Show resolved
Hide resolved
extensions/pyRevitTools.extension/pyRevit.tab/Analysis.panel/ColorSplasher.pushbutton/script.py
Outdated
Show resolved
Hide resolved
extensions/pyRevitTools.extension/pyRevit.tab/Analysis.panel/ColorSplasher.pushbutton/script.py
Show resolved
Hide resolved
extensions/pyRevitTools.extension/pyRevit.tab/Analysis.panel/ColorSplasher.pushbutton/script.py
Show resolved
Hide resolved
extensions/pyRevitTools.extension/pyRevit.tab/Analysis.panel/ColorSplasher.pushbutton/script.py
Show resolved
Hide resolved
…olorSplasher.pushbutton/ColorSplasherWindow.ResourceDictionary.es_es.xaml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…olorSplasher.pushbutton/ColorSplasherWindow.ResourceDictionary.chinese_s.xaml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…olorSplasher.pushbutton/script.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
- Improved the logic for applying gradient colors to enhance clarity and maintainability. - Streamlined the process of updating existing ValuesInfo objects while preserving their data. - Enhanced error handling and event management during color updates for a smoother user experience.
…itlabs/pyRevit into localize-color-splasher-ui
- Added comments to clarify optional error handling for document closure, ScrollViewer setup, icon loading, and event handler unsubscription. - Improved robustness of the ColorSplasherWindow by ensuring the application continues smoothly even when certain operations fail.
- Enhanced the exception handling for horizontal scrollbar visibility in the ColorSplasherWindow. - Added debug logging to capture details when scrollbar configuration fails, ensuring better diagnostics without disrupting the UI.
- Removed redundant assignment of the window variable to streamline the code. - Ensured that the window variable is only accessed when necessary, improving clarity and performance. - Maintained existing error handling and UI behavior during view selection.
- Introduced new translations for buttons, tooltips, and messages in the ColorSplasherWindow.ResourceDictionary.de_de.xaml file. - Added options for "Select All" and "Select None" functionalities to enhance user experience. - Updated tooltips to provide clearer guidance on selection actions.
- Added translations for "Select All" and "Select None" buttons to enhance user functionality. - Updated tooltips for selection actions in both languages to improve user guidance. - Removed duplicate entries for buttons and tooltips to streamline the resource dictionaries.
|
@tay0thman Please give it a ride and merge if good to go video recording of implementation
|
|
Nice Idea! I didn't run into issues yet, only the font size is way too small for a high dpi screen. EDIT: also #2941 could be used for positioning |
Do you have a screen capture, so that I can adjust?
The floor is yours, show me! @Wurschdhaud |
|
@jmcouffin I like it, and I agree on the font size: I don't think the update captured the issue #3001
|
|
📦 New work-in-progress (wip) builds are available for 5.3.1.26023+2136-wip |
|
📦 New work-in-progress (wip) builds are available for 5.3.1.26023+2141-wip |
|
📦 New work-in-progress (wip) builds are available for 5.3.1.26025+1329-wip |
|
📦 New work-in-progress (wip) builds are available for 5.3.1.26025+1418-wip |
|
📦 New work-in-progress (wip) builds are available for 5.3.1.26030+2037-wip |
|
📦 New work-in-progress (wip) builds are available for 5.3.1.26030+2039-wip |
|
📦 New work-in-progress (wip) builds are available for 5.3.1.26030+2101-wip |
|
📦 New work-in-progress (wip) builds are available for 5.3.1.26030+2136-wip |
|
📦 New work-in-progress (wip) builds are available for 5.3.1.26030+2147-wip |
|
📦 New work-in-progress (wip) builds are available for 5.3.1.26030+2212-wip |
|
📦 New work-in-progress (wip) builds are available for 5.3.1.26032+1043-wip |
|
📦 New work-in-progress (wip) builds are available for 5.3.1.26032+1111-wip |
|
📦 New work-in-progress (wip) builds are available for 5.3.1.26032+1304-wip |
|
📦 New work-in-progress (wip) builds are available for 5.3.1.26032+1323-wip |
|
📦 New work-in-progress (wip) builds are available for 5.3.1.26032+1433-wip |
|
📦 New work-in-progress (wip) builds are available for 5.3.1.26032+1538-wip |
|
📦 New work-in-progress (wip) builds are available for 5.3.1.26032+1543-wip |
|
📦 New work-in-progress (wip) builds are available for 5.3.1.26032+1553-wip |
|
📦 New work-in-progress (wip) builds are available for 5.3.1.26032+1612-wip |
|
📦 New work-in-progress (wip) builds are available for 5.3.1.26032+1624-wip |
|
📦 New work-in-progress (wip) builds are available for 5.3.1.26032+1738-wip |
|
📦 New work-in-progress (wip) builds are available for 5.3.1.26032+1743-wip |
|
📦 New work-in-progress (wip) builds are available for 5.3.1.26032+1829-wip |
|
📦 New work-in-progress (wip) builds are available for 5.3.1.26032+1937-wip |
|
📦 New work-in-progress (wip) builds are available for 6.0.0.26032+1956-wip |
|
📦 New work-in-progress (wip) builds are available for 6.0.0.26032+2005-wip |
|
📦 New work-in-progress (wip) builds are available for 6.0.0.26032+2008-wip |
|
📦 New public release are available for 6.0.0.26032+2040 |
|
📦 New public release are available for 6.0.0.26032+2040 |


Description
Checklist
Before submitting your pull request, ensure the following requirements are met:
pipenv run black {source_file_or_directory}Related Issues
If applicable, link the issues resolved by this pull request: