Browse files

Carousel theme, hint spacing

  • Loading branch information...
1 parent 536e703 commit f3f536877cebe51db39da26ab799bb1a76f53c3a steve committed Nov 27, 2009
Showing with 16 additions and 7 deletions.
  1. +2 −0 Makefile
  2. +6 −2 config.c
  3. +1 −1 data/themes/carousel/theme.xml
  4. +6 −4 hint.c
  5. +1 −0 include/config.h
View
2 Makefile
@@ -23,6 +23,8 @@ install: cabrio
$(INSTALL) -m 644 -t $(DATA_DIR)/pixmaps data/pixmaps/*
$(INSTALL) -m 644 -t $(DATA_DIR)/sounds data/sounds/*
$(INSTALL) -m 755 -d $(DATA_DIR)/themes
+ $(INSTALL) -m 755 -d $(DATA_DIR)/themes/carousel
+ $(INSTALL) -m 644 -t $(DATA_DIR)/themes/carousel data/themes/carousel/*
$(INSTALL) -m 755 -d $(DATA_DIR)/themes/ice
$(INSTALL) -m 644 -t $(DATA_DIR)/themes/ice data/themes/ice/*
$(INSTALL) -m 755 -d $(DATA_DIR)/themes/industrial
View
8 config.c
@@ -139,7 +139,6 @@ static const char *tag_theme_menu = "menu";
static const char *tag_theme_menu_item_width = "item-width";
static const char *tag_theme_menu_item_height = "item-height";
static const char *tag_theme_menu_items_visible = "items-visible";
-static const char *tag_theme_menu_spacing = "spacing";
static const char *tag_theme_menu_border = "border";
static const char *tag_theme_submenu = "submenu";
static const char *tag_theme_submenu_item_width = "item-width";
@@ -205,6 +204,7 @@ static const char *tag_match = "match";
static const char *tag_category = "category";
static const char *tag_emulator = "emulator";
static const char *tag_default = "default";
+static const char *tag_spacing = "spacing";
/* Common values */
static const char *config_empty = "";
@@ -1017,7 +1017,7 @@ int config_read_menu( xmlNode *node, struct config_menu *menu ) {
else if( strcmp( (char*)node->name, tag_theme_menu_items_visible ) == 0 ) {
config_read_integer( (char*)node->name, (char*)xmlNodeGetContent(node), &menu->max_visible );
}
- else if( strcmp( (char*)node->name, tag_theme_menu_spacing ) == 0 ) {
+ else if( strcmp( (char*)node->name, tag_spacing ) == 0 ) {
if( strcasecmp( (char*)xmlNodeGetContent(node), config_auto ) == 0 )
menu->spacing = -1;
else
@@ -1134,6 +1134,9 @@ int config_read_hints( xmlNode *node, struct config_hints *hints ) {
else if( strcmp( (char*)node->name, tag_theme_hints_image_arrow ) == 0 ) {
strncpy( hints->image_arrow, (char*)xmlNodeGetContent(node), CONFIG_FILE_NAME_LENGTH );
}
+ else if( strcmp( (char*)node->name, tag_spacing ) == 0 ) {
+ config_read_float( (char*)node->name, (char*)xmlNodeGetContent(node), &hints->spacing );
+ }
else {
fprintf( stderr, warn_skip, tag_theme_hints, node->name );
}
@@ -2245,6 +2248,7 @@ int config_new( void ) {
default_theme.hints.offset2 = -1.2;
default_theme.hints.size = 1;
default_theme.hints.pulse = 1;
+ default_theme.hints.spacing = 0;
snprintf( default_theme.hints.image_back, CONFIG_FILE_NAME_LENGTH, "%s%s", DATA_DIR, default_back_texture );
snprintf( default_theme.hints.image_select, CONFIG_FILE_NAME_LENGTH, "%s%s", DATA_DIR, default_select_texture );
snprintf( default_theme.hints.image_arrow, CONFIG_FILE_NAME_LENGTH, "%s%s", DATA_DIR, default_arrow_texture );
View
2 data/themes/carousel/theme.xml
@@ -11,7 +11,6 @@
<items-visible>5</items-visible>
<primary-offset>0</primary-offset>
<secondary-offset>2</secondary-offset>
- <!--auto-hide>true</auto-hide-->
<font-scale>0.8</font-scale>
<border>20%</border>
</menu>
@@ -22,6 +21,7 @@
<primary-offset>-2.2</primary-offset>
<secondary-offset>0</secondary-offset>
<size>0.8</size>
+ <spacing>4.6</spacing>
</hints>
<snap>
<primary-offset>-0.8</primary-offset>
View
10 hint.c
@@ -142,6 +142,8 @@ void hint_draw_arrow( struct arrow *arrow ) {
}
int hint_draw( void ) {
+ GLfloat spacing = config_get()->iface.theme.hints.spacing;
+
if( config_get()->iface.theme.hints.pulse ) {
if( alpha >= 1.0 ) {
alpha_step = -ALPHA_STEP_SIZE;
@@ -164,10 +166,10 @@ int hint_draw( void ) {
hint_draw_caption( text_back_message, -BUTTON_SIZE/2 - ((text_back_message->width*FONT_SCALE)/2 + (BUTTON_SIZE/2)) );
break;
case FOCUS_GAMESEL:
- hint_draw_button( back_texture, -BUTTON_SIZE/2 );
- hint_draw_caption( text_select_message, BUTTON_SIZE/2 + ((text_select_message->width*FONT_SCALE)/2 + (BUTTON_SIZE/2)) );
- hint_draw_button( select_texture, BUTTON_SIZE/2 );
- hint_draw_caption( text_back_message, -BUTTON_SIZE/2 - ((text_back_message->width*FONT_SCALE)/2 + (BUTTON_SIZE/2)) );
+ hint_draw_button( back_texture, -(spacing/2) - (BUTTON_SIZE/2) );
+ hint_draw_caption( text_back_message, -(spacing/2) - BUTTON_SIZE/2 - ((text_select_message->width*FONT_SCALE)/2 + (BUTTON_SIZE/2)) );
+ hint_draw_button( select_texture, BUTTON_SIZE/2 + (spacing/2) );
+ hint_draw_caption( text_select_message, BUTTON_SIZE/2 + (spacing/2) + ((text_back_message->width*FONT_SCALE)/2 + (BUTTON_SIZE/2)) );
break;
default:
break;
View
1 include/config.h
@@ -171,6 +171,7 @@ struct config_hints {
float offset1;
float offset2;
float size;
+ float spacing;
int pulse;
char image_back[CONFIG_FILE_NAME_LENGTH];
char image_select[CONFIG_FILE_NAME_LENGTH];

0 comments on commit f3f5368

Please sign in to comment.