summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2014-08-29 16:40:38 +0000
committerDavid Robillard <d@drobilla.net>2014-08-29 16:40:38 +0000
commitedc189c98fe4f3f4bbadc273dcaca0eb6b31704c (patch)
tree0ffd1c24afc70a6c7da6853c5439f9ad38ceafde /src
parent704605973d7775fb3c80136490e316921947900f (diff)
downloadingen-edc189c98fe4f3f4bbadc273dcaca0eb6b31704c.tar.gz
ingen-edc189c98fe4f3f4bbadc273dcaca0eb6b31704c.tar.bz2
ingen-edc189c98fe4f3f4bbadc273dcaca0eb6b31704c.zip
Use complete Gtk style from file for embedded UIs.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5456 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r--src/gui/App.cpp22
-rw-r--r--src/gui/NodeModule.cpp4
-rw-r--r--src/gui/ingen_style.rc155
-rw-r--r--src/gui/wscript8
4 files changed, 169 insertions, 20 deletions
diff --git a/src/gui/App.cpp b/src/gui/App.cpp
index 22a5a95c..e6fe35dc 100644
--- a/src/gui/App.cpp
+++ b/src/gui/App.cpp
@@ -100,6 +100,10 @@ App::~App()
SPtr<App>
App::create(Ingen::World* world)
{
+ // Add RC file for embedded GUI Gtk style
+ const std::string rc_path = Ingen::data_file_path("ingen_style.rc");
+ Gtk::RC::add_default_file(rc_path);
+
_main = Gtk::Main::instance();
if (!_main) {
Glib::set_application_name("Ingen");
@@ -118,24 +122,6 @@ App::create(Ingen::World* world)
app->_about_dialog->property_logo_icon_name() = "ingen";
gtk_window_set_default_icon_name("ingen");
- // Set style for embedded block GUIs
- const string rc_style =
- "style \"ingen_embedded_node_gui_style\" {\n"
- "bg[NORMAL] = \"#1E2224\"\n"
- "bg[ACTIVE] = \"#505050\"\n"
- "bg[PRELIGHT] = \"#525454\"\n"
- "bg[SELECTED] = \"#99A0A0\"\n"
- "bg[INSENSITIVE] = \"#F03030\"\n"
- "fg[NORMAL] = \"#FFFFFF\"\n"
- "fg[ACTIVE] = \"#FFFFFF\"\n"
- "fg[PRELIGHT] = \"#FFFFFF\"\n"
- "fg[SELECTED] = \"#FFFFFF\"\n"
- "fg[INSENSITIVE] = \"#FFFFFF\"\n"
- "}\n"
- "widget \"*ingen_embedded_node_gui_container*\" style \"ingen_embedded_node_gui_style\"\n";
-
- Gtk::RC::parse_string(rc_style);
-
return SPtr<App>(app);
}
diff --git a/src/gui/NodeModule.cpp b/src/gui/NodeModule.cpp
index 1eb07b2b..b9798339 100644
--- a/src/gui/NodeModule.cpp
+++ b/src/gui/NodeModule.cpp
@@ -231,8 +231,8 @@ NodeModule::embed_gui(bool embed)
_gui_widget = Glib::wrap(c_widget);
Gtk::Container* container = new Gtk::EventBox();
- container->set_name("ingen_embedded_node_gui_container");
- container->set_border_width(2.0);
+ container->set_name("IngenEmbeddedUI");
+ container->set_border_width(4.0);
container->add(*_gui_widget);
Ganv::Module::embed(container);
} else {
diff --git a/src/gui/ingen_style.rc b/src/gui/ingen_style.rc
new file mode 100644
index 00000000..d42e934c
--- /dev/null
+++ b/src/gui/ingen_style.rc
@@ -0,0 +1,155 @@
+style "ingen-default"
+{
+ GtkMenuItem::selected_shadow_type = out
+
+ GtkWidget::interior_focus = 1
+ GtkWidget::focus_padding = 1
+
+ GtkButton::default_border = { 0, 0, 0, 0 }
+ GtkButton::default_outside_border = { 0, 0, 0, 0 }
+
+ GtkCheckButton::indicator_size = 12
+ GtkExpander::expander_size = 16
+ GtkMenuBar::internal-padding = 0
+ GtkPaned::handle_size = 6
+ GtkRange::slider_width = 15
+ GtkRange::stepper_size = 15
+ GtkRange::trough_border = 0
+ GtkScrollbar::min_slider_length = 30
+ GtkTreeView::expander_size = 14
+ GtkTreeView::odd_row_color = "#343"
+
+ xthickness = 1
+ ythickness = 1
+
+ fg[NORMAL] = "#B8BBB9"
+ fg[PRELIGHT] = "#B8BBB9"
+ fg[ACTIVE] = "#B8BBB9"
+ fg[SELECTED] = "#B8BBB9"
+ fg[INSENSITIVE] = "#48494B"
+
+ bg[NORMAL] = "#282B29"
+ bg[PRELIGHT] = "#383B39"
+ bg[ACTIVE] = "#383B39"
+ bg[SELECTED] = "#00A150"
+ bg[INSENSITIVE] = "#282B29"
+
+ base[NORMAL] = "#111"
+ base[PRELIGHT] = "#222"
+ base[ACTIVE] = "#0A2"
+ base[SELECTED] = "#0A2"
+ base[INSENSITIVE] = "#444"
+
+ text[NORMAL] = "#EEE"
+ text[PRELIGHT] = "#EEE"
+ text[ACTIVE] = "#EEE"
+ text[SELECTED] = "#EEE"
+ text[INSENSITIVE] = "#666"
+
+ engine "clearlooks"
+ {
+ contrast = 1.0
+ }
+}
+
+style "ingen-progressbar" = "ingen-default"
+{
+ xthickness = 1
+ ythickness = 1
+}
+
+style "ingen-wide" = "ingen-default"
+{
+ xthickness = 2
+ ythickness = 2
+}
+
+style "ingen-notebook" = "ingen-wide"
+{
+ bg[NORMAL] = "#383B39"
+ bg[ACTIVE] = "#383B39"
+}
+
+style "ingen-tasklist" = "ingen-default"
+{
+ xthickness = 5
+ ythickness = 3
+}
+
+style "ingen-menu" = "ingen-default"
+{
+ xthickness = 5
+ ythickness = 5
+ bg[NORMAL] = "#262626"
+}
+
+style "ingen-menu-item" = "ingen-default"
+{
+ xthickness = 2
+ ythickness = 3
+}
+
+style "ingen-menu-itembar" = "ingen-default"
+{
+ xthickness = 3
+ ythickness = 3
+}
+
+style "ingen-tree" = "ingen-default"
+{
+ xthickness = 2
+ ythickness = 2
+}
+
+style "ingen-frame-title" = "ingen-default"
+{
+ fg[NORMAL] = "#B8BBB9"
+}
+
+style "ingen-panel" = "ingen-default"
+{
+ xthickness = 3
+ ythickness = 3
+}
+
+style "ingen-tooltips" = "ingen-default"
+{
+ xthickness = 4
+ ythickness = 4
+ bg[NORMAL] = "#585B59"
+}
+
+style "ingen-combo" = "ingen-default"
+{
+ xthickness = 1
+ ythickness = 2
+}
+
+class "*Ingen*GtkWidget" style : highest "ingen-default"
+class "*Ingen*GtkButton" style : highest "ingen-wide"
+class "*Ingen*GtkRange" style : highest "ingen-wide"
+class "*Ingen*GtkFrame" style : highest "ingen-wide"
+class "*Ingen*GtkStatusbar" style : highest "ingen-wide"
+class "*Ingen*GtkMenu" style : highest "ingen-menu"
+class "*Ingen*GtkMenuItem" style : highest "ingen-menu-item"
+widget_class "*Ingen*MenuItem.*" style : highest "ingen-menu-item"
+widget_class "*Ingen*.GtkAccelMenuItem.*" style : highest "ingen-menu-item"
+widget_class "*Ingen*.GtkRadioMenuItem.*" style : highest "ingen-menu-item"
+widget_class "*Ingen*.GtkCheckMenuItem.*" style : highest "ingen-menu-item"
+widget_class "*Ingen*.GtkImageMenuItem.*" style : highest "ingen-menu-item"
+widget_class "*Ingen*.GtkSeparatorMenuItem.*" style : highest "ingen-menu-item"
+class "*Ingen*GtkEntry" style : highest "ingen-wide"
+widget_class "*Ingen*.tooltips.*.GtkToggleButton" style : highest "ingen-tasklist"
+widget_class "*Ingen*.GtkTreeView.GtkButton" style : highest "ingen-tree"
+widget_class "*Ingen*.GtkCTree.GtkButton" style : highest "ingen-tree"
+widget_class "*Ingen*.GtkList.GtkButton" style : highest "ingen-tree"
+widget_class "*Ingen*.GtkCList.GtkButton" style : highest "ingen-tree"
+widget_class "*Ingen*.GtkFrame.GtkLabel" style : highest "ingen-frame-title"
+widget_class "*Ingen*BasePWidget.GtkEventBox.GtkTable.GtkFrame" style : highest "ingen-panel"
+widget "gtk-tooltips" style : highest "ingen-tooltips"
+class "*Ingen*GtkNotebook" style : highest "ingen-notebook"
+class "*Ingen*GtkProgressBar" style : highest "ingen-progressbar"
+widget_class "*Ingen*.GtkComboBox.GtkButton" style : highest "ingen-combo"
+widget_class "*Ingen*.GtkCombo.GtkButton" style : highest "ingen-combo"
+
+widget "*Ingen*" style : highest "ingen-default"
diff --git a/src/gui/wscript b/src/gui/wscript
index cb6086a7..c62f98a3 100644
--- a/src/gui/wscript
+++ b/src/gui/wscript
@@ -67,6 +67,14 @@ def build(bld):
chmod = Utils.O755,
INGEN_VERSION = bld.env.INGEN_VERSION)
+ # Gtk style
+ bld(features = 'subst',
+ is_copy = True,
+ source = 'ingen_style.rc',
+ target = '../../ingen_style.rc',
+ install_path = '${DATADIR}/ingen',
+ chmod = Utils.O755)
+
# LV2 UI
obj = bld(features = 'cxx cxxshlib',
source = 'ingen_gui_lv2.cpp',