diff options
author | der richter <der.richter@gmx.de> | 2019-03-29 20:38:02 +0100 |
---|---|---|
committer | Jan Ekström <jeebjp@gmail.com> | 2019-04-02 02:09:01 +0300 |
commit | 837e5058ff110247229057f7ab182a041d1c98b8 (patch) | |
tree | 5946977ba0e69eede15d6a2e988dae2ac728876f /osdep | |
parent | 23f55569beda4ed53e4d85a12769ef41f05f96ca (diff) | |
download | mpv-837e5058ff110247229057f7ab182a041d1c98b8.tar.bz2 mpv-837e5058ff110247229057f7ab182a041d1c98b8.tar.xz |
cocoa-cb: refactor title bar styling
half of the materials we used were deprecated with macOS 10.14, broken
and not supported by run time changes of the macOS theme. furthermore
our styling names were completely inconsistent with the actually look
since macOS 10.14, eg ultradark got a lot brighter and couldn't be
considered ultradark anymore.
i decided to drop the old option --macos-title-bar-style and rework
the whole mechanism to allow more freedom. now materials and appearance
can be set separately. even if apple changes the look or semantics in
the future the new options can be easily adapted.
Diffstat (limited to 'osdep')
-rw-r--r-- | osdep/macOS_mpv_helper.swift | 2 | ||||
-rw-r--r-- | osdep/macosx_application.h | 2 | ||||
-rw-r--r-- | osdep/macosx_application.m | 19 |
3 files changed, 20 insertions, 3 deletions
diff --git a/osdep/macOS_mpv_helper.swift b/osdep/macOS_mpv_helper.swift index 8ceada6d2e..b456c8d59e 100644 --- a/osdep/macOS_mpv_helper.swift +++ b/osdep/macOS_mpv_helper.swift @@ -57,6 +57,8 @@ class MPVHelper: NSObject { mpv_observe_property(mpvHandle, 0, "border", MPV_FORMAT_FLAG) mpv_observe_property(mpvHandle, 0, "keepaspect-window", MPV_FORMAT_FLAG) mpv_observe_property(mpvHandle, 0, "macos-title-bar-style", MPV_FORMAT_STRING) + mpv_observe_property(mpvHandle, 0, "macos-title-bar-appearance", MPV_FORMAT_STRING) + mpv_observe_property(mpvHandle, 0, "macos-title-bar-material", MPV_FORMAT_STRING) } func initRender() { diff --git a/osdep/macosx_application.h b/osdep/macosx_application.h index 0301e49fcb..5f33a384f2 100644 --- a/osdep/macosx_application.h +++ b/osdep/macosx_application.h @@ -22,6 +22,8 @@ struct macos_opts { int macos_title_bar_style; + int macos_title_bar_appearance; + int macos_title_bar_material; int macos_fs_animation_duration; int cocoa_cb_sw_renderer; }; diff --git a/osdep/macosx_application.m b/osdep/macosx_application.m index 086d51fef3..4653b7177d 100644 --- a/osdep/macosx_application.m +++ b/osdep/macosx_application.m @@ -43,14 +43,27 @@ #define OPT_BASE_STRUCT struct macos_opts const struct m_sub_options macos_conf = { .opts = (const struct m_option[]) { - OPT_CHOICE("macos-title-bar-style", macos_title_bar_style, 0, - ({"dark", 0}, {"ultradark", 1}, {"light", 2}, - {"mediumlight", 3}, {"auto", 4})), + OPT_CHOICE("macos-title-bar-appearance", macos_title_bar_appearance, 0, + ({"auto", 0}, {"aqua", 1}, {"darkAqua", 2}, + {"vibrantLight", 3}, {"vibrantDark", 4}, + {"aquaHighContrast", 5}, {"darkAquaHighContrast", 6}, + {"vibrantLightHighContrast", 7}, + {"vibrantDarkHighContrast", 8})), + OPT_CHOICE("macos-title-bar-material", macos_title_bar_material, 0, + ({"titlebar", 0}, {"selection", 1}, {"menu", 2}, + {"popover", 3}, {"sidebar", 4}, {"headerView", 5}, + {"sheet", 6}, {"windowBackground", 7}, {"hudWindow", 8}, + {"fullScreen", 9}, {"toolTip", 10}, {"contentBackground", 11}, + {"underWindowBackground", 12}, {"underPageBackground", 13}, + {"dark", 14}, {"light", 15}, {"mediumLight", 16}, + {"ultraDark", 17})), OPT_CHOICE_OR_INT("macos-fs-animation-duration", macos_fs_animation_duration, 0, 0, 1000, ({"default", -1})), OPT_CHOICE("cocoa-cb-sw-renderer", cocoa_cb_sw_renderer, 0, ({"auto", -1}, {"no", 0}, {"yes", 1})), + OPT_REMOVED("macos-title-bar-style", "Split into --macos-title-bar-appearance " + "and --macos-title-bar-material"), {0} }, .size = sizeof(struct macos_opts), |