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 MacosThemeData to properly apply user-defined component theme classes. #182

Merged
merged 6 commits into from Mar 13, 2022

Conversation

whiplashoo
Copy link
Collaborator

Fixes an issue where user-defined theme properties pushButtonTheme, helpButtonTheme, and tooltipTheme were not passed properly when creating a custom MacosThemeData.

Now, a user can customize a theme like this:

return MacosApp(
  darkTheme: MacosThemeData.dark().copyWith(
    pushButtonTheme: const PushButtonThemeData().copyWith(
      color: MacosColors.appleBrown,
      disabledColor: MacosColors.applePurple,
      secondaryColor: MacosColors.appleMagenta,
    ),
    helpButtonTheme: const HelpButtonThemeData(
      color: MacosColors.appleOrange,
      disabledColor: MacosColors.appleCyan,
    ),
    tooltipTheme: const TooltipThemeData(
      height: 100.0,
    ),
  ),
)

and get properly styled PushButton, HelpButton, and MacosTooltip (not shown) widgets:

Screenshot 2022-03-12 at 11 02 05 PM

Also changed a couple of colors in the example/main.dart, to remove its Material library dependency.

Pre-launch Checklist

  • I have run dartfmt on all changed files
  • I have incremented the package version as appropriate and updated CHANGELOG.md with my changes
  • I have added/updated relevant documentation
  • I have run "optimize/organize imports" on all changed files
  • I have addressed all analyzer warnings as best I could

…, `helpButtonTheme`, and `tooltipTheme` properties, and remove import of material.dart in example app
@whiplashoo
Copy link
Collaborator Author

Got a couple of failing tests, will check again.

@whiplashoo
Copy link
Collaborator Author

OK, there is also another issue with the components' ThemeData classes, that caused these tests to fail with null-check errors.

These occur when a user defines the PushButtonThemeData for the theme without explicitly setting all of its constructor properties. For example, trying to customize only the color of PushButtons via the theme:

theme: MacosThemeData.light().copyWith(
  pushButtonTheme: PushButtonThemeData(
    color: MacosColors.appleOrange,
  ),
),

causes a CastError (null-check) on Line 232, because disabledColor ends up being null (and another one later, because secondaryColor also ends up being null).

I believe we want the user to be able to set just color and not have to explicitly set the other two properties to their default values. The same happens with helpButtonTheme, tooltipTheme, macosIconButtonTheme, macosPopupButtonTheme.

One solution would be to provide the default colors inside the widgets as well, via theme-level properties. This is how Flutter's material theme does it, for example on FloatingActionButtons:

final Color foregroundColor = this.foregroundColor
  ?? floatingActionButtonTheme.foregroundColor
  ?? theme.colorScheme.onSecondary;
final Color backgroundColor = this.backgroundColor
  ?? floatingActionButtonTheme.backgroundColor
  ?? theme.colorScheme.secondary;
final Color focusColor = this.focusColor
  ?? floatingActionButtonTheme.focusColor
  ?? theme.focusColor;

This would require to populate MacosThemeData with more top-level properties, and then just initialize the component themes without setting anything.

@GroovinChip
Copy link
Collaborator

@whiplashoo I'm also seeing these failing tests. The problem is coming from the fact that in our tests we are not passing any values to the theme classes. See for example line 22 of push_button_test.dart. When pass values to the theme data class, the test passes.

@GroovinChip
Copy link
Collaborator

All tests should pass now.

@codecov
Copy link

codecov bot commented Mar 13, 2022

Codecov Report

Merging #182 (f661b99) into dev (f82570a) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##              dev     #182   +/-   ##
=======================================
  Coverage   62.66%   62.66%           
=======================================
  Files          33       33           
  Lines        3337     3337           
=======================================
  Hits         2091     2091           
  Misses       1246     1246           
Impacted Files Coverage Δ
lib/src/theme/macos_theme.dart 54.95% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f82570a...f661b99. Read the comment docs.

@GroovinChip GroovinChip self-assigned this Mar 13, 2022
@GroovinChip GroovinChip merged commit 4f76af8 into dev Mar 13, 2022
@GroovinChip GroovinChip deleted the fix_theme_classes branch March 13, 2022 15:59
@whiplashoo
Copy link
Collaborator Author

Indeed, the tests should pass now. However, I am still seeing the null-check error, when initializing a PushButtonTheme with just one property, like:

theme: MacosThemeData.light().copyWith(
  pushButtonTheme: PushButtonThemeData(
    color: MacosColors.appleOrange,
  ),
),

Screenshot 2022-03-13 at 6 21 33 PM

Am I missing something?

@GroovinChip
Copy link
Collaborator

@whiplashoo I'll look into it

@GroovinChip
Copy link
Collaborator

GroovinChip commented Mar 13, 2022

I'm thinking the problem is we are missing merge() methods for MacosThemeData and various widget ThemeData classes. See here and here for examples

@whiplashoo
Copy link
Collaborator Author

OK, that looks doable. I will try to work on it soon.

@GroovinChip
Copy link
Collaborator

OK, that looks doable. I will try to work on it soon.

Thanks!

GroovinChip added a commit that referenced this pull request May 3, 2022
* Added brightness resolver to theme brightness

* Improved dialog design

* Added showMacosAlertDialog

* Created custom route with transitions for dialog

* Added Navigator.pop to dialog page buttons

* Added documentation

* Fixed dialog padding and added TextAlign.center to title

* Bumped version

* Improved formatting

* Fixed barrier curve

* Fixed transitionDuration

* Update dart_code_metrics

* Update dart_code_metrics

* Fix #148 (#149)

* Fix #148

* Add trailing comma

* chore: Add more MacosIconButtons to example

* chore: Remove box shadows for `MacosIconButton`

* chore: update dart_code_metrics

* Layout refactor (#153)

* Create window.dart

* make TitleBar a widget

* refactor Scaffold

* Delete resizable_pane_notifier.dart

* Update window.dart

* refactor ResizablePane

* Update content_area.dart

* Update macos_ui.dart

* update example

* fix imports

* Update CHANGELOG.md

* window: use sidebar topOffset

* sidebar: add topOffset

* Update README.md

* Update pubspec.yaml

* Update pubspec.lock

* [window] add slide transition to sidebar toggle

* update examples

* [titlebar] add customization properties

* fix buttons example

* [titlebar] use defaultTargetPlatform and remove dart:io

* [titlebar] show window controls safe area only on macOS

* add swift code block to README

* Update MainFlutterWindow.swift

* change scaffoldBreakpoint to windowBreakpoint on ResizablePane and Sidebar

* [titlebar] adjust for no MacosWindowScope

* [window] refactor out unnecessary code

* [scaffold] update assertion messages

* [window] show content in a ClipRect

* Update README.md

* update example

* update readme screenshots

* docs: add a class level doc for sidebar.dart

* docs: update docs for sidebar.dart

Co-authored-by: groovinchip <groovinchip@gmail.com>

* 0.7.1+1 - fix docs for PushButtonThemeData, update dart_code_metrics

* chore: update CHANGELOG.md

* chore: remove old todo

* chore: update README.md

add note about manual sidebar toggling

* generic support wip

* chore: update dart_code_metrics

* chore: ignore coverage_report

* chore: ignore coverage

* feat: add radio buttons to example

* chore: update CHANGELOG.md and version

* Tests! (#158)

* chore: ignore coverage_report

* chore: ignore coverage

* feat: update HelpButton

* feat: update HelpButton lerp

* chore: remove extra blank line

* chore: add mocktail to project

* test: add HelpButtonTheme tests

* test: add HelpButton tests

* chore: remove unused import

* chore: update PushButton.copyWith()

* chore: update PushButton().lerp()

* feat: add == and hashCode to PushButtonThemeData

* test: fix HelpButtonThemeData lerp tests

* test: add PushButtonThemeData tests

* fix: fix PushButtonThemeData == override

* test: update HelpButton onPressed test

* test: ensure _handleTapCancel gets called

* test: add push_button_test.dart

* chore: add action for uploading coverage reports to codecov

* chore: update codecov.yaml

* chore: add codecov action badge

* chore: try to fix coverage not getting uploaded

* chore: try to fix coverage not getting uploaded (2)

* chore: add codecov badge to README.md

* chore: add pana badge to README.md

* test: add icon_button_test.dart

* test: add debugFillProp test to icon_button_test.dart

* chore: run flutter format

* test: add checkbox_test.dart

* test: add back_button_test.dart

* chore: remove unnecessary imports

* chore: run pub get after branch merge

* test: fix handleTap tests

* test: add fillColor to increase coverage

* test: create radio_button_test.dart

* test: create switch_test.dart

* test: create macos_colors_test.dart

* chore: update dart_code_metrics

* chore: remove unused variable

* feat: export material colors in library.dart

* chore: upgrade tooltip copyWith

* test: create tooltip_theme_test.dart

* test: create tooltip_test.dart

* test: add link to flutter test

* test: tweak tooltip_test.dart

* test: create text_field_test.dart

* chore: fix file name

* chore: upgrade ScrollBarThemeData copyWith

* test: create scrollbar_theme_test.dart

* test: create capacity_indicators_test.dart

* test: create progress_indicator_test.dart

* test: fix wrong test

* test: create rating_indicator_test.dart

* test: create relevance_indicator_test.dart

* chore: update analysis_options.yaml and files to match

* chore: run flutter format

* chore: bump CHANGELOG.md and version

* chore: add missing trailing comma

* fix: fix bug where cursor would not change caret location on mouse click (#159)

* chore: run pub get

* 0.8.0 - `MacosSheet` and `MacosListTile` (#160)

* feat: add macos_sheet.dart

Also export a few more things from library.dart

* feat: make MacosSheet non-barrier dismissible, per HIG

* docs: add documentation to macos_sheet.dart

* chore: tweak default sheet padding

* chore: tweak dialogs demo page

* feat: add MacosListTile

* chore: update version and CHANGELOG.md

* docs: add docs for MacosListTile

* chore: update sheet, listtile demo with better styling

* chore: update README.md with new widgets

* chore: run flutter format

* chore: minor text update to demo

* feat: 0.8.1

fixes MacosSheet not having an outer border radius

* chore: update mocktail

* `MacosListTile` updates (#161)

* chore: switch to MacosListTile in demo

* chore: fix demo theme

* feat: add leadingWhitespace prop to MacosListTile and add DefaultTextStyles to title and subtitle

* chore(demo): remove styling from MacosListTile in MacosSheet

* feat(demo): add another MacosListTile to MacosSheet

* feat(package): add onClick and onLongPress callsbacks to MacosListTile

* feat(package): add mouseCursor property

* chore(package): remove accidental newline

* chore(package): run dartfmt on macos_list_tile.dart

* chore(package): update CHANGELOG.md, version

* test(package): add macos_list_tile_test.dart

Also swap the MouseRegion and GestureDetector in MacosListTile

* chore(package): remove unused import

* test(package): add a subtitle to one of the MacosListTile tests

* feat(package): 0.9.0 - native context menus! (#162)

* feat(package): 0.9.0 - native context menus!

* chore(package): update chore: update README.md with note about native_context_menu

* chore(package): update pana_analysis.yml to account for new pub score post version 0.9.0

* chore(package): create flutter_analysis.yml

* chore(package): update flutter_analysis.yml

* chore(package): update README.md with another badge

* 0.9.1 Icon button updates (#164)

* feat(package): create MacosIconButtonTheme and MacosIconButtonThemeData

* chore(package): add missing trailing comma

* feat(package): set default MacosIconButtonThemeData

* chore(package): update MacosIconButtonThemeData `==`

* chore(package): add missing trailing comma

* test(package): add icon_button_theme_test.dart

* docs(package): add docs for MacosIconButtonTheme and MacosIconButtonThemeData

* chore: update native_context_menu

* chore(package): remove unnecessary VisualDensity from MacosThemeData.dark()

* feat(package): Update MacosIconButton to use values from MacosIconButtonThemeData

* chore(demo): Update buttons page

* chore(package): Update version, CHANGELOG.md

* test(package): fix failing test

* 0.9.2 - Fix mouse cursors (#165)

* feat(package): upgrade mouse cursors and add configurable MouseCursor props

Mouse cursors now almost all default to SystemMouseCursors.basic to more closely adhere with Apple norms

* chore(package): update version, CHANGELOG.md

* chore(package): finish editing, CHANGELOG.md

* 0.9.3 - Add isSecondary flag to PushButtons (#167)

* added isSecondary flag to PushButtons: sets its background color to gray hues for use in Cancel or Go back actions, updated example pages (buttons & dialogs)

* run pre-launch checks and updates

* fix tests for PushButton and PushButtonTheme

* cocoapods version

* 0.10.0 - `MacosIcon`, `MacosIconTheme`, and `MacosIconThemeData` (#169)

* feat(package): create MacosIcon, MacosIconTheme, and MacosIconThemeData

* docs(package): add missing docs for MacosIconButtonThemeData

* feat(package): export macos_icon.dart

* feat(package): add icon theme to macos_theme.dart

* fix(package): fix MacosIcon not respecting MacosThemeData

* fix(demo): migrate Icons to MacosIcons

* chore(package): run flutter format

* fix(package): fix MacosIconThemeData `==`

* fix(package): fix MacosIconThemeData `==` for test

* chore(package): add missing trailing comma

* test(package): add icon_theme_test.dart

* chore(package): bump version, update CHANGELOG.md

* chore(package): update README.md

* chore(package): update CONTRIBUTING.md

* chore: update native_context_menu

* chore: update changelog

* add missed trailing comma (#172)

* Create FUNDING.yml

* chore: update pubspec.locl

* Sidebar transparency effect (#175)

* Transparency sidebar effect

Added a transparency effect to the sidebar

* fix: Formatted window.dart

* chore: update changelog, version

* fix: removed unused imports

* fix: applied enhancement from @jmatth

this fixes weird behavior on windows and web

* fix: double null check

widget.sidebar.decoration.color was checked twice
(according to suggestion by @jmatth)

* Sidebar transparency effect (#175)

* Transparency sidebar effect

Added a transparency effect to the sidebar

* fix: Formatted window.dart

* chore: update changelog, version

* fix: removed unused imports

* fix: applied enhancement from @jmatth

this fixes weird behavior on windows and web

* fix: double null check

widget.sidebar.decoration.color was checked twice
(according to suggestion by @jmatth)

* chore: update changelog.md

* Add hover effects for `MacosIconButton` and `MacosBackButton` (closes #168) (#171)

* `MacosPopupButton` (closes #176) (#177)

* feat(package): create `MacosPopupButton`, feat(demo): add `MacosPopupButton` example in buttons page

* fix(package): cleanup `MacosPopupButton` class properties that are not required, docs(package): adapt documentation for `MacosPopupButton`

* docs(package): improve documentation for `MacosPopupButton`'s properties

* fix(package): improve up/down caret design in `MacosPopupButton` to match native one

* add debugFillProperties to `MacosPopupButton`

* test(package): add popup_button_test.dart

* docs(package): add documentation for `MacosPopupButton`

* chore(package): update changelog and version

* chore: fix unnecessary imports

* Update example/macos/Podfile.lock

* add `MacosPopupButtonTheme` and `MacosPopupButtonThemeData` classes with overridable properties highlightColor, backgroundColor, popupColor

* test: add tests for MacosPopupTheme classes

* chore: cleanup project files, revert example theme

* Update lib/src/buttons/popup_button.dart

* Update lib/src/buttons/popup_button.dart

* Update lib/src/buttons/popup_button.dart

* Update lib/src/buttons/popup_button.dart

* Update pubspec.yaml

Co-authored-by: Reuben Turner <groovinchip@gmail.com>

* chore(package): remove dependency on native_context_menu

Closes #179.

Removes all references to context menus.

* chore(package): update min dart sdk and fix lints

* chore(package): update CHANGELOG.md

* fix: Sidebar and ResizablePane more closely track native MacOS behavior (#178)

* fix: Sidebar and ResizablePane more closely track native MacOS behavior

Updating Sidebar and ResizablePane to resize relative to the start of
the drag session, rather than based on each drag delta. This fixes an
issue where dragging past min or max width and then back would continue
to resize even though the mouse wasn't over the divider.

Updating Sidebar to "pop" open and closed when crossing the minWidth
threshold during a drag session, which matches native behavior.

* fix: removing leftover print statements

* feat: adding options for more complex sidebar drag behavior

* chore: Fixing CHANGELOG typos

* fix: Preventing exception by marking required parameter required instead of optional

* chore: Adding tests for ResizablePane

* fix: Resizeable pane no longer subtly jumps 2.5 logical pixels at start of drag

* chore: Updating ResizablePane tests to test both left and right cases

* fix: Sidebar no longer subtly jumps a few logical pixels at start of drag

* chore: adding tests for sidebar behavior

* Update lib/src/layout/sidebar.dart

* chore: removing leftover debug print statements from ResizablePane

* chore: refactor window tests to use widget type and position rather than arbitrary keys

* chore: Update version in CHANGELOG.md

Co-authored-by: Reuben Turner <groovinchip@gmail.com>

* chore: Removing trailing spaces to keep the formatter happy

* chore: removing new from docstring to keep the analyzer happy

* chore: Bumping version in pubspec.yaml

Co-authored-by: Reuben Turner <groovinchip@gmail.com>

* Fix `MacosThemeData` to properly apply user-defined component theme classes. (#182)

* fix `MacosThemeData` to properly apply user-defined `pushButtonTheme`, `helpButtonTheme`, and `tooltipTheme` properties, and remove import of material.dart in example app

* chore: update changelog and pubspec.yaml

* chore(package): fix failing push button tests

* chore(package): fix failing help button tests

* chore(package): dartfmt

Co-authored-by: Reuben Turner <groovinchip@gmail.com>

* chore(package): update dependencies

* Add merge methods to `MacosThemeData` and widget-specific `ThemeData` classes (closes #183) (#186)

* fix: add missing merge methods for `MacosThemeData` and widget-level `ThemeData` classes

* chore: update changelog and pubspec

* feat: added padding property to IconButton (#185)

* feat: added padding property to IconButton

* Fix failing tests

* Bumped version to 0.12.3

* Ensure padding gets merged into theme

Co-authored-by: Reuben Turner <groovinchip@gmail.com>

* chore(example): regenerate macos runner & fix accompanying lint warnings

* chore(example): fix lint warnings

* fix: address #170 (#192)

* fix: address #170

* chore: optimize imports

* chore: remove bundled fonts (closes #187)

* chore: update CHANGELOG.md

* feat: optional mouse cursor for sidebar (closes #181)

* fix: Fix active sidebar item icon color (closes #190)

* chore: remove unnecessary import

* fix: use correct default font family

* Fix bottom padding for alert dialogs when supress is null (#189)

* Update bottom padding for alert dialogs when supress is null

* Update changelog with changes made

* Update version in pubspec.yaml to match change log

* regenerate pubspec.lock

* chore: start working on DatePickerField

* MacosPulldownButton (closes #86) (#193)

* feat: duplicate MacosPopupButton to use as base for implementing MacosPulldownButton

* refactor: change PulldownMenuItem layout

* refactor: remove up/down carets for not visible items

* refactor: replace updown carets with single down caret at the edge of the MacosPulldownButton

* refactor: revert removing up/down carets for not visible items

* refactor: remove onChanged callback

* feat: MacosPullDownButton basic functionality and appearance

* refactor: use Container instead of CustomPaint to draw PulldownMenu, apply proper frosted glass effect and border styling

* feat: finalize styling of PulldownMenu and PulldownButton

* refactor: color and shadow of PulldownButton

* refactor: work on menu's placement behavior

* refactor: remove leading property for PulldownMenuItems and clean up

* refactor: finalize styling and behavior for disabled state

* refactor: handle styling of disabled Pulldown items

* feat: add MacosPulldownMenuDivider to Pulldown menu

* feat: implement PulldownMenu to have icon instead of hint

* feat: handle styling for all button states

* fix: color of enabled PulldownButtons text

* fix: cleanup and change examples

* fix: add documentation and cleanup

* test: add tests for MacosPulldownButton, fix API issues

* test: add tests for MacosPulldownTheme

* chore: use const constructor

* fix: example buttons page duplicate content

* chore: update changelog, readme, and version

* chore: revert deleting example/ios folder

* fix: revert changing semanticLabel to title after refactoring for MacosIcon

* chore: add link to Apple docs in README

* chore: optimize imports

* chore: minor code style changes

* chore: change version

Co-authored-by: GroovinChip <groovinchip@gmail.com>

* feat: caret painters

* feat: working field portion of MacosDatePicker

* refactor: PickerElement -> FieldElement

* feat: working MacosDatePicker

* Improve `MacosPopupButton` design (#194)

* feat: duplicate MacosPopupButton to use as base for implementing MacosPulldownButton

* refactor: change PulldownMenuItem layout

* refactor: remove up/down carets for not visible items

* refactor: replace updown carets with single down caret at the edge of the MacosPulldownButton

* refactor: revert removing up/down carets for not visible items

* refactor: remove onChanged callback

* feat: MacosPullDownButton basic functionality and appearance

* refactor: use Container instead of CustomPaint to draw PulldownMenu, apply proper frosted glass effect and border styling

* feat: finalize styling of PulldownMenu and PulldownButton

* refactor: color and shadow of PulldownButton

* refactor: work on menu's placement behavior

* refactor: remove leading property for PulldownMenuItems and clean up

* refactor: finalize styling and behavior for disabled state

* refactor: handle styling of disabled Pulldown items

* feat: add MacosPulldownMenuDivider to Pulldown menu

* feat: implement PulldownMenu to have icon instead of hint

* feat: handle styling for all button states

* fix: color of enabled PulldownButtons text

* fix: cleanup and change examples

* fix: add documentation and cleanup

* test: add tests for MacosPulldownButton, fix API issues

* test: add tests for MacosPulldownTheme

* chore: use const constructor

* fix: example buttons page duplicate content

* chore: update changelog, readme, and version

* chore: revert deleting example/ios folder

* fix: revert changing semanticLabel to title after refactoring for MacosIcon

* chore: add link to Apple docs in README

* fix: remove Orientation-related code from MacosPopupButton

* fix: remove unused imports and lastOrientation variable

* fix: docs fix for MacosPopupButtonThemeData

* feat: add frosted glass effect on MacosPopupButton using a BackdropFilter

* refactor: remove elevation property from MacosPopupButton (was not used at all)

* fix: improve frosted glass effect for MacosPulldownButton

* feat: improve styling of MacosPopupButton to better match Apple design, adjust disabled state

* refactor/test: remove unused iconColor and iconDisabledColor properties, add test for debugFillProperties

* chore: update changelog and pubspec

* fix: improve painting of up/down carets in MacosPopupButton to not paint on the same Point twice

* chore: minor code formatting changes

Co-authored-by: GroovinChip <groovinchip@gmail.com>

* chore: update dart_code_metrics

* refactor: switch to flutter_lints

closes #201

* chore: move theme classes to their own files

Closes #200

* chore: flutter format

* chore: remove unnecessary const

* feat: MacosDatePickerTheme & MacosDatePickerThemeData

* fix: fix light theme colors

* chore: PhysicalModel for calendar view

* chore: reduce spacing between text-only picker and calendar

* chore: fix day headers

* fix: fix right & left month controls breaking when going past 1 or 12

* test: add tests for MacosDatePicker

* chore: bump version & changelog

* chore: run flutter format

* chore: remove DateFormat parameter & intl dependency

* feat: style options

Textual, Graphical, and Combined

* docs: docs for MacosDatePicker

* fix: add padding to selectors page in example

* fix: add proper styling for selected date boxes (background and text colors) in both textual and graphical views

* fix: right-align all dates in graphical view and add some padding to match macOS styling

* chore: Minor style fixes for MacosTextField

* fix: change border and box shadow styling, disabled background color and border radius for MacosTextField

* fix: set correct background/placeholder/icon colors for disabled fields

* chore: add const

* version `0.0.14`: Implements `ToolBar`, relevant `ToolbarItem`s, and `MacosSearchField` (#209)

* initial work on Toolbar, include it in MacosScaffold

* feat: separate ToolBar from TitleBar, implement ToolBarIconButton, ToolBarPulldownButton widgets, work on ToolBar styling

* feat: implement ToolbarImageButton widget

* feat: add overflow handling for toolbar

* feat: work on toolbar overflow button menu

* feat: implement overflow menu functionality, allow for using ToolbarSpacers

* fix: use proper grey colors for toolbar icon and image buttons

* fix: MacosPulldownButton properties should get their values from closest MacosPulldownButtonTheme, use it for ToolbarPulldownButton

* fix: MacosPopupButton properties should get their values from closest MacosPopupButtonTheme

* feat: allow for setting divider color for title bar and toolbar via their constructors

* refactor: move title bar to MacosWindow instead of MacosScaffold

* refactor: allow for setting the MacosPulldownMenu alignment to the right or left of the button, to avoid having it clipped at the edge of the window

* feat: work on enabling submenus for overflowed toolbar pulldown buttons

* feat: finalize overflowed toolbar menu behavior, add documentation for toolbar-related widgets

* refactor: merge ToolbarImageButton in ToolbarIconButton and update docstrings

* docs: improve documentation for toolbar and title bar

* refactor: move all new toolbar-related widgets and utilities to appropriate directories

* refactor: add titleWidth property to Toolbar, create example page showcasing a Toolbar and its widgets

* feat: add first implementation of MacosSearchField

* fix: issues after merging changes to widget themes

* feat: implement MacosSearchField widget, based on MacosTextField

* fix: toolbar icon button disabled color

* fix: add padding to MacosWindow when a title bar is available (instead of moving the ContentArea with the top property of Positioned)

* fix: make overflow button half its size when Toolbar contains only items that have labels below them, update example pages

* fix: add toolbar in example buttons page new page route

* docs: update README with documentation on Toolbar and MacosSearchField, update screenshots

* chore: update changelog and pubspec.yaml

* chore: address analyzer warnings

* chore: use simple Positioned for title bar

* chore: fix failing tests for PulldownButton and PulldownButtonTheme

* fix: removed unused constant from text field

* Update lib/src/buttons/toolbar/toolbar_icon_button.dart

* Update lib/src/buttons/toolbar/toolbar_icon_button.dart

* Update lib/src/buttons/toolbar/toolbar_icon_button.dart

* Update lib/src/buttons/toolbar/toolbar_pulldown_button.dart

* Update lib/src/buttons/toolbar/toolbar_pulldown_button.dart

* Update lib/src/layout/toolbar/toolbar.dart

* Update lib/src/buttons/toolbar/toolbar_pulldown_button.dart

* Update lib/src/layout/toolbar/toolbar.dart

* Update lib/src/layout/toolbar/toolbar.dart

* Update lib/src/layout/toolbar/toolbar.dart

* Update lib/src/layout/toolbar/toolbar.dart

* Update lib/src/layout/toolbar/toolbar.dart

* chore(example: update window transparency technique

* docs: update guide for achieving modern window look

Closes #184

* chore(example): update filenames

* chore(example): unified look throughout pages

Also add MacosSwitch to buttons page

* fix: fix MacosDatePicker incorrect color issue

* chore: run dart fix --apply

Co-authored-by: Reuben Turner <groovinchip@gmail.com>

* version `0.15.0` - Adds `MacosColorWell` (#211)

* feat: first pass at MacosColorWell

* feat: add ColorPickerMode to MacosColorWell

* chore: format swift files and delete commented code

* chore: bump version, changelog

* docs: update docs

* chore: remove stray code

* chore: add flutter version constraint

* feat: add pr prelaunch & publish scripts

* chore: update CONTRIBUTING.md

* chore: update pubspec.lock

* chore: improve prelaunch script

* chore: add git push to script

* chore: add push prompts to script

* chore: update CONTRIBUTING.md to reference the prelaunch script

* chore: update podspec

* chore: update min Flutter version constraint

cannot publish otherwise

* version `0.16.0` - `MacosTimePicker` (#214)

* feat: first pass at MacosColorWell

* feat: add ColorPickerMode to MacosColorWell

* chore: format swift files and delete commented code

* chore: bump version, changelog

* docs: update docs

* chore: remove stray code

* chore: add flutter version constraint

* feat: add pr prelaunch & publish scripts

* chore: update CONTRIBUTING.md

* chore: update pubspec.lock

* feat: textual MacosTimePicker

* docs: fix docs for MacosDatePicker

* chore: minor fixes for MacosDatePicker

* feat(example): demo textual MacosTimePicker

* chore: update version, changelog, readme

* chore: run pre-launch tasks

* chore: update file name

* feat: graphical MacosTimePicker

* chore: improve prelaunch script

* chore: add git push to script

* chore: add push prompts to script

* chore: update CONTRIBUTING.md to reference the prelaunch script

* chore: update podspec

* chore: more accurate inner shadow

Still not as accurate as I'd like

* chore: add missing elevation to PhysicalModel

* chore(example): improve look of selectors page

* chore: update README.md

* docs: update README.md

* Update macos_ui.dart

* Update macos_theme.dart

* Update lib/src/selectors/graphical_time_picker_painter.dart

* Update lib/src/selectors/graphical_time_picker_painter.dart

* Update lib/src/selectors/graphical_time_picker_painter.dart

* Update lib/src/selectors/graphical_time_picker_painter.dart

* Update lib/src/selectors/graphical_time_picker_painter.dart

* feat: up-down keyboard actions for textual pickers

Although for some reason it's not working

* chore: remove unnecessary import

* fix: use a FocusNode to listen to keyboard shortcuts for date picker

* fix: keyboard shortcuts for time picker

* fix: docstrings for KeyboardShortcutRunner

Co-authored-by: Minas Giannekas <whiplashoo@users.noreply.github.com>
Co-authored-by: Minas Giannekas <whiplashoo721@gmail.com>

* chore(example): update dependencies

* chore: bump to 1.0 in preparation for release

* chore: update CHANGELOG.md in preparation for stable release

* chore: update CONTRIBUTING.md to remove beta references

Co-authored-by: Wilson Wilson <wilsonwilsondev@gmail.com>
Co-authored-by: Leslie Arkorful <lesliearkorful@gmail.com>
Co-authored-by: Sacha Arbonel <sacha.arbonel@hotmail.fr>
Co-authored-by: Minas Giannekas <whiplashoo@users.noreply.github.com>
Co-authored-by: Dmitry Krutskikh <dmitry.krutskikh@gmail.com>
Co-authored-by: mj-shifu <77107165+mj-shifu@users.noreply.github.com>
Co-authored-by: Josh Matthews <josh@jmatth.com>
Co-authored-by: Craig Edwards <craig@blackdogfoundry.com>
Co-authored-by: Andrew Gabriel <Andrew@andrewtechful.com>
Co-authored-by: Minas Giannekas <whiplashoo721@gmail.com>
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.

None yet

2 participants