]> git.mdlowis.com Git - proto/labwc.git/commitdiff
Merge theme.c and theme-builtin.c
authorJohan Malm <jgm323@gmail.com>
Sun, 21 Feb 2021 22:13:18 +0000 (22:13 +0000)
committerJohan Malm <jgm323@gmail.com>
Sun, 21 Feb 2021 22:13:18 +0000 (22:13 +0000)
include/theme/theme.h
src/theme/meson.build
src/theme/theme-builtin.c [deleted file]
src/theme/theme.c

index 1287c3cfcf134c54cceb6ae19647a36f540bdeca..f175682ec3f71fecb4d8975b457621f92f7b034a 100644 (file)
@@ -33,13 +33,6 @@ struct theme {
        struct wlr_texture *xbm_iconify_inactive_unpressed;
 };
 
-/**
- * parse_hexstr - parse #rrggbb
- * @hex: hex string to be parsed
- * @rgba: pointer to float[4] for return value
- */
-void parse_hexstr(const char *hex, float *rgba);
-
 /**
  * theme_init - read openbox theme and generate button textures
  * @theme: theme data
@@ -56,11 +49,4 @@ void theme_init(struct theme *theme, struct wlr_renderer *renderer,
  */
 void theme_finish(struct theme *theme);
 
-/**
- * theme_builin - apply built-in theme similar to Clearlooks
- * Note: Only used if no theme can be found. Default values for individual
- * theme options are as per openbox spec and are typically black/white.
- */
-void theme_builtin(struct theme *theme);
-
 #endif /* __LABWC_THEME_H */
index 7800344ac802eb2ae1540efd7ea43b7ab42273e2..a9bef667c75b0ed293cbaafb46bdb0723123eda4 100644 (file)
@@ -1,5 +1,4 @@
 labwc_sources += files(
   'theme.c',
-  'theme-builtin.c',
 )
 
diff --git a/src/theme/theme-builtin.c b/src/theme/theme-builtin.c
deleted file mode 100644 (file)
index aa79ce6..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * We generally use Openbox defaults, but if no theme file can be found it's
- * better to populate the theme variables with some sane values as no-one
- * wants to use openbox without a theme - it'll all just be black and white.
- *
- * Openbox doesn't actual start if it can't find a theme. As it's normally
- * packaged with Clearlooks, this is not a problem, but for labwc I thought
- * this was a bit hard-line. People might want to try labwc without having
- * Openbox (and associated themes) installed.
- */
-
-#include "theme/theme.h"
-
-void theme_builtin(struct theme *theme)
-{
-       parse_hexstr("#589bda", theme->window_active_title_bg_color);
-       parse_hexstr("#3c7cb7", theme->window_active_handle_bg_color);
-       parse_hexstr("#efece6", theme->window_inactive_title_bg_color);
-       parse_hexstr("#ffffff", theme->window_active_button_unpressed_image_color);
-       parse_hexstr("#000000", theme->window_inactive_button_unpressed_image_color);
-       parse_hexstr("#fcfbfa", theme->menu_items_bg_color);
-       parse_hexstr("#000000", theme->menu_items_text_color);
-       parse_hexstr("#4a90d9", theme->menu_items_active_bg_color);
-       parse_hexstr("#ffffff", theme->menu_items_active_text_color);
-}
index ddf393bcb7f9a1dacef5a2a8a65e922a0601e0ba..6944851676852bbb7196e80dfb2529ffb65693d2 100644 (file)
@@ -28,6 +28,11 @@ hex_to_dec(char c)
        return 0;
 }
 
+/**
+ * parse_hexstr - parse #rrggbb
+ * @hex: hex string to be parsed
+ * @rgba: pointer to float[4] for return value
+ */
 void
 parse_hexstr(const char *hex, float *rgba)
 {
@@ -44,6 +49,31 @@ parse_hexstr(const char *hex, float *rgba)
        }
 }
 
+/*
+ * We generally use Openbox defaults, but if no theme file can be found it's
+ * better to populate the theme variables with some sane values as no-one
+ * wants to use openbox without a theme - it'll all just be black and white.
+ *
+ * Openbox doesn't actual start if it can't find a theme. As it's normally
+ * packaged with Clearlooks, this is not a problem, but for labwc I thought
+ * this was a bit hard-line. People might want to try labwc without having
+ * Openbox (and associated themes) installed.
+ *
+ * theme_builtin() applies a theme very similar to Clearlooks-3.4
+ */
+void theme_builtin(struct theme *theme)
+{
+       parse_hexstr("#589bda", theme->window_active_title_bg_color);
+       parse_hexstr("#3c7cb7", theme->window_active_handle_bg_color);
+       parse_hexstr("#efece6", theme->window_inactive_title_bg_color);
+       parse_hexstr("#ffffff", theme->window_active_button_unpressed_image_color);
+       parse_hexstr("#000000", theme->window_inactive_button_unpressed_image_color);
+       parse_hexstr("#fcfbfa", theme->menu_items_bg_color);
+       parse_hexstr("#000000", theme->menu_items_text_color);
+       parse_hexstr("#4a90d9", theme->menu_items_active_bg_color);
+       parse_hexstr("#ffffff", theme->menu_items_active_text_color);
+}
+
 static bool
 match(const gchar *pattern, const gchar *string)
 {