mirror of
https://github.com/elementary/gala.git
synced 2024-08-17 02:50:38 +03:00
Hardcode accent colors (#1683)
This commit is contained in:
parent
c26f0a0920
commit
878a918c53
@ -1,21 +1,6 @@
|
||||
/*
|
||||
* Copyright 2021 elementary, Inc. (https://elementary.io)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public
|
||||
* License along with this program; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Copyright 2021-2023 elementary, Inc. <https://elementary.io>
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
* Authored by: Marius Meisenzahl <mariusmeisenzahl@gmail.com>
|
||||
*/
|
||||
|
||||
@ -41,16 +26,16 @@ public class Gala.AccentColorManager : Object {
|
||||
private Settings interface_settings;
|
||||
|
||||
private NamedColor[] theme_colors = {
|
||||
new NamedColor ("Blue", THEME_BLUE),
|
||||
new NamedColor ("Mint", THEME_MINT),
|
||||
new NamedColor ("Green", THEME_GREEN),
|
||||
new NamedColor ("Yellow", THEME_YELLOW),
|
||||
new NamedColor ("Orange", THEME_ORANGE),
|
||||
new NamedColor ("Red", THEME_RED),
|
||||
new NamedColor ("Pink", THEME_PINK),
|
||||
new NamedColor ("Purple", THEME_PURPLE),
|
||||
new NamedColor ("Brown", THEME_BROWN),
|
||||
new NamedColor ("Gray", THEME_GRAY)
|
||||
new NamedColor ("Blue", THEME_BLUE, new Drawing.Color.from_int (0x3689e6)),
|
||||
new NamedColor ("Mint", THEME_MINT, new Drawing.Color.from_int (0x28bca3)),
|
||||
new NamedColor ("Green", THEME_GREEN, new Drawing.Color.from_int (0x68b723)),
|
||||
new NamedColor ("Yellow", THEME_YELLOW, new Drawing.Color.from_int (0xf9c440)),
|
||||
new NamedColor ("Orange", THEME_ORANGE, new Drawing.Color.from_int (0xffa154)),
|
||||
new NamedColor ("Red", THEME_RED, new Drawing.Color.from_int (0xed5353)),
|
||||
new NamedColor ("Pink", THEME_PINK, new Drawing.Color.from_int (0xde3e80)),
|
||||
new NamedColor ("Purple", THEME_PURPLE, new Drawing.Color.from_int (0xa56de2)),
|
||||
new NamedColor ("Brown", THEME_BROWN, new Drawing.Color.from_int (0x8a715e)),
|
||||
new NamedColor ("Gray", THEME_GRAY, new Drawing.Color.from_int (0x667885))
|
||||
};
|
||||
|
||||
construct {
|
||||
|
@ -1,21 +1,6 @@
|
||||
/*
|
||||
* Copyright 2021 elementary, Inc. (https://elementary.io)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public
|
||||
* License along with this program; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Copyright 2021-2023 elementary, Inc. <https://elementary.io>
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
* Authored by: Marius Meisenzahl <mariusmeisenzahl@gmail.com>
|
||||
*/
|
||||
|
||||
@ -24,11 +9,11 @@ public class Gala.NamedColor : Object {
|
||||
public string theme { get; construct set; }
|
||||
public Drawing.Color color { get; construct set; }
|
||||
|
||||
public NamedColor (string name, string theme) {
|
||||
public NamedColor (string name, string theme, Drawing.Color color) {
|
||||
Object (
|
||||
name: name,
|
||||
theme: theme,
|
||||
color: InternalUtils.get_accent_color_by_theme_name (theme)
|
||||
color: color
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -1,19 +1,9 @@
|
||||
//
|
||||
// Copyright (C) 2012 Tom Beckmann, Rico Tzschichholz
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
/*
|
||||
* Copyright 2012 Tom Beckmann
|
||||
* Copyright 2012 Rico Tzschichholz
|
||||
* Copyright 2023 elementary, Inc. <https://elementary.io>
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace Gala {
|
||||
public enum InputArea {
|
||||
@ -323,24 +313,6 @@ namespace Gala {
|
||||
);
|
||||
}
|
||||
|
||||
public static Drawing.Color get_accent_color_by_theme_name (string theme_name) {
|
||||
var label_widget_path = new Gtk.WidgetPath ();
|
||||
label_widget_path.append_type (GLib.Type.from_name ("label"));
|
||||
label_widget_path.iter_set_object_name (-1, "selection");
|
||||
|
||||
var selection_style_context = new Gtk.StyleContext ();
|
||||
unowned Gtk.CssProvider theme_provider = Gtk.CssProvider.get_named (theme_name, null);
|
||||
selection_style_context.add_provider (theme_provider, Gtk.STYLE_PROVIDER_PRIORITY_USER);
|
||||
selection_style_context.set_path (label_widget_path);
|
||||
|
||||
var rgba = (Gdk.RGBA) selection_style_context.get_property (
|
||||
Gtk.STYLE_PROPERTY_BACKGROUND_COLOR,
|
||||
Gtk.StateFlags.NORMAL
|
||||
);
|
||||
|
||||
return new Drawing.Color.from_rgba (rgba);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the workspaces geometry following the only_on_primary settings.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user