fix: add Wayland support (#26022)

This commit is contained in:
Valentin Hăloiu 2020-10-20 20:24:52 +02:00 committed by GitHub
parent d38c47e748
commit c4525b4ea6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 272 additions and 159 deletions

View file

@ -17,7 +17,7 @@
#include "ui/views/layout/box_layout.h"
#include "ui/views/widget/widget.h"
#if defined(USE_X11)
#if defined(OS_LINUX)
#include "ui/gtk/gtk_util.h"
#endif
@ -282,7 +282,7 @@ void MenuBar::ButtonPressed(views::Button* source, const ui::Event& event) {
void MenuBar::RefreshColorCache() {
const ui::NativeTheme* theme = GetNativeTheme();
if (theme) {
#if defined(USE_X11)
#if defined(OS_LINUX)
background_color_ = gtk::GetBgColor("GtkMenuBar#menubar");
enabled_color_ =
gtk::GetFgColor("GtkMenuBar#menubar GtkMenuItem#menuitem GtkLabel");
@ -319,7 +319,7 @@ void MenuBar::UpdateViewColors() {
// set child colors
if (menu_model_ == nullptr)
return;
#if defined(USE_X11)
#if defined(OS_LINUX)
const auto& textColor = has_focus_ ? enabled_color_ : disabled_color_;
for (auto* child : GetChildrenInZOrder()) {
auto* button = static_cast<SubmenuButton*>(child);

View file

@ -90,7 +90,7 @@ class MenuBar : public views::AccessiblePaneView,
void RefreshColorCache();
SkColor background_color_;
#if defined(USE_X11)
#if defined(OS_LINUX)
SkColor enabled_color_;
SkColor disabled_color_;
#endif