Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Carousel theme, hint spacing

  • Loading branch information...
commit f3f536877cebe51db39da26ab799bb1a76f53c3a 1 parent 536e703
steve authored
2  Makefile
@@ -23,6 +23,8 @@ install: cabrio
23 23 $(INSTALL) -m 644 -t $(DATA_DIR)/pixmaps data/pixmaps/*
24 24 $(INSTALL) -m 644 -t $(DATA_DIR)/sounds data/sounds/*
25 25 $(INSTALL) -m 755 -d $(DATA_DIR)/themes
  26 + $(INSTALL) -m 755 -d $(DATA_DIR)/themes/carousel
  27 + $(INSTALL) -m 644 -t $(DATA_DIR)/themes/carousel data/themes/carousel/*
26 28 $(INSTALL) -m 755 -d $(DATA_DIR)/themes/ice
27 29 $(INSTALL) -m 644 -t $(DATA_DIR)/themes/ice data/themes/ice/*
28 30 $(INSTALL) -m 755 -d $(DATA_DIR)/themes/industrial
8 config.c
@@ -139,7 +139,6 @@ static const char *tag_theme_menu = "menu";
139 139 static const char *tag_theme_menu_item_width = "item-width";
140 140 static const char *tag_theme_menu_item_height = "item-height";
141 141 static const char *tag_theme_menu_items_visible = "items-visible";
142   -static const char *tag_theme_menu_spacing = "spacing";
143 142 static const char *tag_theme_menu_border = "border";
144 143 static const char *tag_theme_submenu = "submenu";
145 144 static const char *tag_theme_submenu_item_width = "item-width";
@@ -205,6 +204,7 @@ static const char *tag_match = "match";
205 204 static const char *tag_category = "category";
206 205 static const char *tag_emulator = "emulator";
207 206 static const char *tag_default = "default";
  207 +static const char *tag_spacing = "spacing";
208 208
209 209 /* Common values */
210 210 static const char *config_empty = "";
@@ -1017,7 +1017,7 @@ int config_read_menu( xmlNode *node, struct config_menu *menu ) {
1017 1017 else if( strcmp( (char*)node->name, tag_theme_menu_items_visible ) == 0 ) {
1018 1018 config_read_integer( (char*)node->name, (char*)xmlNodeGetContent(node), &menu->max_visible );
1019 1019 }
1020   - else if( strcmp( (char*)node->name, tag_theme_menu_spacing ) == 0 ) {
  1020 + else if( strcmp( (char*)node->name, tag_spacing ) == 0 ) {
1021 1021 if( strcasecmp( (char*)xmlNodeGetContent(node), config_auto ) == 0 )
1022 1022 menu->spacing = -1;
1023 1023 else
@@ -1134,6 +1134,9 @@ int config_read_hints( xmlNode *node, struct config_hints *hints ) {
1134 1134 else if( strcmp( (char*)node->name, tag_theme_hints_image_arrow ) == 0 ) {
1135 1135 strncpy( hints->image_arrow, (char*)xmlNodeGetContent(node), CONFIG_FILE_NAME_LENGTH );
1136 1136 }
  1137 + else if( strcmp( (char*)node->name, tag_spacing ) == 0 ) {
  1138 + config_read_float( (char*)node->name, (char*)xmlNodeGetContent(node), &hints->spacing );
  1139 + }
1137 1140 else {
1138 1141 fprintf( stderr, warn_skip, tag_theme_hints, node->name );
1139 1142 }
@@ -2245,6 +2248,7 @@ int config_new( void ) {
2245 2248 default_theme.hints.offset2 = -1.2;
2246 2249 default_theme.hints.size = 1;
2247 2250 default_theme.hints.pulse = 1;
  2251 + default_theme.hints.spacing = 0;
2248 2252 snprintf( default_theme.hints.image_back, CONFIG_FILE_NAME_LENGTH, "%s%s", DATA_DIR, default_back_texture );
2249 2253 snprintf( default_theme.hints.image_select, CONFIG_FILE_NAME_LENGTH, "%s%s", DATA_DIR, default_select_texture );
2250 2254 snprintf( default_theme.hints.image_arrow, CONFIG_FILE_NAME_LENGTH, "%s%s", DATA_DIR, default_arrow_texture );
2  data/themes/carousel/theme.xml
@@ -11,7 +11,6 @@
@@ -22,6 +21,7 @@
10 hint.c
@@ -142,6 +142,8 @@ void hint_draw_arrow( struct arrow *arrow ) {
142 142 }
143 143
144 144 int hint_draw( void ) {
  145 + GLfloat spacing = config_get()->iface.theme.hints.spacing;
  146 +
145 147 if( config_get()->iface.theme.hints.pulse ) {
146 148 if( alpha >= 1.0 ) {
147 149 alpha_step = -ALPHA_STEP_SIZE;
@@ -164,10 +166,10 @@ int hint_draw( void ) {
164 166 hint_draw_caption( text_back_message, -BUTTON_SIZE/2 - ((text_back_message->width*FONT_SCALE)/2 + (BUTTON_SIZE/2)) );
165 167 break;
166 168 case FOCUS_GAMESEL:
167   - hint_draw_button( back_texture, -BUTTON_SIZE/2 );
168   - hint_draw_caption( text_select_message, BUTTON_SIZE/2 + ((text_select_message->width*FONT_SCALE)/2 + (BUTTON_SIZE/2)) );
169   - hint_draw_button( select_texture, BUTTON_SIZE/2 );
170   - hint_draw_caption( text_back_message, -BUTTON_SIZE/2 - ((text_back_message->width*FONT_SCALE)/2 + (BUTTON_SIZE/2)) );
  169 + hint_draw_button( back_texture, -(spacing/2) - (BUTTON_SIZE/2) );
  170 + hint_draw_caption( text_back_message, -(spacing/2) - BUTTON_SIZE/2 - ((text_select_message->width*FONT_SCALE)/2 + (BUTTON_SIZE/2)) );
  171 + hint_draw_button( select_texture, BUTTON_SIZE/2 + (spacing/2) );
  172 + hint_draw_caption( text_select_message, BUTTON_SIZE/2 + (spacing/2) + ((text_back_message->width*FONT_SCALE)/2 + (BUTTON_SIZE/2)) );
171 173 break;
172 174 default:
173 175 break;
1  include/config.h
@@ -171,6 +171,7 @@ struct config_hints {
171 171 float offset1;
172 172 float offset2;
173 173 float size;
  174 + float spacing;
174 175 int pulse;
175 176 char image_back[CONFIG_FILE_NAME_LENGTH];
176 177 char image_select[CONFIG_FILE_NAME_LENGTH];

0 comments on commit f3f5368

Please sign in to comment.
Something went wrong with that request. Please try again.