Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Ebb <matt@mke3.net>2006-10-28 17:21:02 +0400
committerMatt Ebb <matt@mke3.net>2006-10-28 17:21:02 +0400
commit3e0c45440d8fd5998a944699feb5afa033e80918 (patch)
treeccab9e9e8541d6e1398d0daa4b52f13f34c7accf
parent129cab4137d2a928e68eec7f7647b1f2b690686a (diff)
* Simple patch 5058 from gsrb3d to use constants instead of magic numbers for
theme drawtypes
-rw-r--r--source/blender/include/BIF_resources.h5
-rw-r--r--source/blender/src/interface.c2
-rw-r--r--source/blender/src/interface_draw.c23
-rw-r--r--source/blender/src/resources.c2
4 files changed, 20 insertions, 12 deletions
diff --git a/source/blender/include/BIF_resources.h b/source/blender/include/BIF_resources.h
index 376895905d7..7525e4efce7 100644
--- a/source/blender/include/BIF_resources.h
+++ b/source/blender/include/BIF_resources.h
@@ -478,6 +478,11 @@ enum {
};
/* XXX WARNING: previous is saved in file, so do not change order! */
+/* theme drawtypes */
+#define TH_MINIMAL 0
+#define TH_SHADED 1
+#define TH_ROUNDED 2
+#define TH_OLDSKOOL 3
/* specific defines per space should have higher define values */
diff --git a/source/blender/src/interface.c b/source/blender/src/interface.c
index 3a4a15a723a..10c97f1f894 100644
--- a/source/blender/src/interface.c
+++ b/source/blender/src/interface.c
@@ -5529,7 +5529,7 @@ void uiBlockEndAlign(uiBlock *block)
int flag= 0, cols=0, rows=0;
int theme= BIF_GetThemeValue(TH_BUT_DRAWTYPE);
- if ( !(theme==0 || theme==1 || theme==2) ) {
+ if ( !(ELEM3(theme, TH_MINIMAL, TH_SHADED, TH_ROUNDED)) ) {
block->flag &= ~UI_BUT_ALIGN; // all 4 flags
return;
}
diff --git a/source/blender/src/interface_draw.c b/source/blender/src/interface_draw.c
index 2d5d8f8a483..84336b2d293 100644
--- a/source/blender/src/interface_draw.c
+++ b/source/blender/src/interface_draw.c
@@ -2275,19 +2275,22 @@ void ui_set_embossfunc(uiBut *but, int drawtype)
else {
int theme= BIF_GetThemeValue(TH_BUT_DRAWTYPE);
- // and the themes
- if(theme==1) {
- but->embossfunc= ui_draw_default;
- but->sliderfunc= ui_default_slider;
- }
- else if(theme==2) {
+ switch(theme) {
+
+ case TH_ROUNDED:
but->embossfunc= ui_draw_round;
- }
- else if(theme==3) {
+ break;
+ case TH_OLDSKOOL:
but->embossfunc= ui_draw_oldskool;
- }
- else {
+ break;
+ case TH_MINIMAL:
but->embossfunc= ui_draw_minimal;
+ break;
+ case TH_SHADED:
+ default:
+ but->embossfunc= ui_draw_default;
+ but->sliderfunc= ui_default_slider;
+ break;
}
}
diff --git a/source/blender/src/resources.c b/source/blender/src/resources.c
index 06e2273b591..42575989dde 100644
--- a/source/blender/src/resources.c
+++ b/source/blender/src/resources.c
@@ -358,7 +358,7 @@ void BIF_InitTheme(void)
SETCOL(btheme->tui.menu_hilite, 0x7F,0x7F,0x7F, 255);
SETCOL(btheme->tui.menu_text, 0, 0, 0, 255);
SETCOL(btheme->tui.menu_text_hi, 255, 255, 255, 255);
- btheme->tui.but_drawtype= 1;
+ btheme->tui.but_drawtype= TH_SHADED;
/* space view3d */
SETCOL(btheme->tv3d.back, 115, 115, 115, 255);