[Bf-blender-cvs] [2246310] UI-experiments: Merge branch 'UI-graphical-redesign' into UI-experiments
Julian Eisel
noreply at git.blender.org
Sat May 30 20:51:02 CEST 2015
Commit: 2246310e3e0eb1e8ad0a5072e3529dda2dc70581
Author: Julian Eisel
Date: Sat May 30 20:50:44 2015 +0200
Branches: UI-experiments
https://developer.blender.org/rB2246310e3e0eb1e8ad0a5072e3529dda2dc70581
Merge branch 'UI-graphical-redesign' into UI-experiments
Conflicts:
source/blender/editors/interface/resources.c
===================================================================
===================================================================
diff --cc source/blender/editors/include/UI_interface.h
index f923ec3,1c93bd7..1bb02b8
--- a/source/blender/editors/include/UI_interface.h
+++ b/source/blender/editors/include/UI_interface.h
@@@ -184,10 -184,9 +184,11 @@@ enum
#define UI_PANEL_WIDTH 340
#define UI_COMPACT_PANEL_WIDTH 160
+ #define UI_PANEL_MARGIN (U.widget_unit * 0.25f)
#define UI_PANEL_CATEGORY_MARGIN_WIDTH (U.widget_unit * 1.0f)
+#define UI_TAB_REGION_MARGIN_HEIGHT (U.widget_unit * 1.15f)
+
/* but->drawflag - these flags should only affect how the button is drawn. */
/* Note: currently, these flags _are not passed_ to the widget's state() or draw() functions
* (except for the 'align' ones)!
diff --cc source/blender/editors/interface/interface_widgets.c
index 4b23ad6,d6845bf..3c9732e
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@@ -3412,54 -3373,6 +3412,54 @@@ static void widget_roundbut(uiWidgetCol
widgetbase_draw(&wtb, wcol);
}
+static void widget_tab(uiBut *but, uiWidgetColors *wcol, rcti *rect, int UNUSED(state), int roundboxalign)
+{
+ uiWidgetBase wtb;
+ uiStyle *style = UI_style_get();
+ const uiFontStyle *fstyle = &style->widget;
+ const int px = (max_ii(1, iroundf(U.pixelsize)));
+ const int fontid = fstyle->uifont_id;
+ const float aspect = but->block->aspect;
+ const float zoom = 1.0f / aspect;
+ const float rad = ((px * 3) * UI_DPI_FAC) * zoom;
+ bool is_active = but->flag & UI_SELECT;
+ unsigned char theme_col_tab_highlight[3];
+
+ /* create outline highlight colors */
+ if (is_active)
+ interp_v3_v3v3_uchar(theme_col_tab_highlight, (unsigned char *)wcol->inner_sel,
+ (unsigned char *)wcol->outline, 0.2f);
+ else
+ interp_v3_v3v3_uchar(theme_col_tab_highlight, (unsigned char *)wcol->inner,
+ (unsigned char *)wcol->outline, 0.12f);
+
+ widget_init(&wtb);
+
+ /* space between tabs */
+ BLI_rcti_resize(rect, BLI_rcti_size_x(rect) - 0.07f * U.dpi, BLI_rcti_size_y(rect));
+ BLI_rcti_translate(rect, -(0.3f * U.widget_unit), 0.2f * U.widget_unit);
+
+ /* copy the new rect to the button's rect */
+ BLI_rctf_resize(&but->rect, BLI_rcti_size_x(rect), BLI_rcti_size_y(rect));
+ BLI_rctf_translate(&but->rect, -(0.3f * U.widget_unit), 0.2f * U.widget_unit);
+
+ /* half rounded */
+ round_box_edges(&wtb, roundboxalign, rect, rad);
+
+ /* draw inner */
- wtb.outline = 0;
++ wtb.draw_outline = 0;
+ widgetbase_draw(&wtb, wcol);
+
+ /* draw outline (3d look) */
+ ui_draw_but_TAB_outline(rect, rad, roundboxalign, theme_col_tab_highlight,
+ is_active ? (unsigned char *)wcol->inner_sel : (unsigned char *)wcol->inner);
+
+ /* text shadow */
+ BLF_enable(fontid, BLF_SHADOW);
+ BLF_shadow(fontid, 3, 1.0f, 1.0f, 1.0f, 0.25f);
+ BLF_shadow_offset(fontid, 0, -1);
+}
+
static void widget_draw_extra_mask(const bContext *C, uiBut *but, uiWidgetType *wt, rcti *rect)
{
uiWidgetBase wtb;
diff --cc source/blender/editors/interface/resources.c
index 87d4037,e2110e9..554fc57
--- a/source/blender/editors/interface/resources.c
+++ b/source/blender/editors/interface/resources.c
@@@ -794,10 -794,15 +794,15 @@@ static void ui_theme_init_new_do(ThemeS
rgba_char_args_set(ts->list_text, 0, 0, 0, 255);
rgba_char_args_set(ts->list_text_hi, 255, 255, 255, 255);
- rgba_char_args_set(ts->tab_active, 114, 114, 114, 255);
- rgba_char_args_set(ts->tab_inactive, 83, 83, 83, 255);
- rgba_char_args_set(ts->tab_back, 64, 64, 64, 255);
- rgba_char_args_set(ts->tab_outline, 60, 60, 60, 255);
+ rgba_char_args_set(ts->tabs.tab_active, 114, 114, 114, 255);
+ rgba_char_args_set(ts->tabs.tab_inactive, 83, 83, 83, 255);
+ rgba_char_args_set(ts->tabs.tab_back, 64, 64, 64, 255);
+ rgba_char_args_set(ts->tabs.tab_outline, 60, 60, 60, 255);
+
+ /* XXX maybe remove show_back/show_header options? */
+ ts->panelcolors.show_back = ts->panelcolors.show_header = true;
+ rgba_char_args_set(ts->panelcolors.back, 128, 128, 128, 255);
+ rgba_char_args_set(ts->panelcolors.header, 97, 97, 97, 255);
}
static void ui_theme_init_new(bTheme *btheme)
@@@ -2624,30 -2642,34 +2642,62 @@@ void init_userdef_do_versions(void
bTheme *btheme;
ThemeSpace *ts;
+ /* interface_widgets.c */
+ struct uiWidgetColors wcol_tab = {
+ {255, 255, 255, 255},
+ {83, 83, 83, 255}, /* gets overwritten later */
+ {114, 114, 114, 255}, /* gets overwritten later */
+ {90, 90, 90, 255},
+
+ {0, 0, 0, 255}, /* gets overwritten later */
+ {0, 0, 0, 255},
+
+ 0,
+ 0, 0
+ };
+
+ for (btheme = U.themes.first; btheme; btheme = btheme->next) {
+ btheme->tui.wcol_tab = wcol_tab;
+ for (ts = UI_THEMESPACE_START(btheme); ts != UI_THEMESPACE_END(btheme); ts++) {
+ copy_v4_v4_char(ts->tabs.tab_active, ts->tab_active);
+ copy_v4_v4_char(ts->tabs.tab_inactive, ts->tab_inactive);
+ copy_v4_v4_char(ts->tabs.tab_back, ts->tab_back);
+ copy_v4_v4_char(ts->tabs.tab_outline, ts->tab_outline);
+ }
+ }
+ }
++
++ if (U.versionfile < 274 || (U.versionfile == 274 && U.subversionfile < 6)) {
++ bTheme *btheme;
++ ThemeSpace *ts;
++
+ for (btheme = U.themes.first; btheme; btheme = btheme->next) {
+ btheme->tui.wcol_box.roundness = 0.2f;
+ btheme->tui.wcol_list_item.roundness = 0.2f;
+ btheme->tui.wcol_menu.roundness = 0.2f;
+ btheme->tui.wcol_menu_back.roundness = 0.25f;
+ btheme->tui.wcol_menu_item.roundness = 0.2f;
+ btheme->tui.wcol_num.roundness = 0.5f;
+ btheme->tui.wcol_numslider.roundness = 0.5f;
+ btheme->tui.wcol_option.roundness = 0.35f;
+ btheme->tui.wcol_progress.roundness = 0.2f;
+ btheme->tui.wcol_pulldown.roundness = 0.2f;
+ btheme->tui.wcol_radio.roundness = 0.2f;
+ btheme->tui.wcol_regular.roundness = 0.2f;
+ btheme->tui.wcol_scroll.roundness = 0.5f;
+ btheme->tui.wcol_text.roundness = 0.2f;
+ btheme->tui.wcol_toggle.roundness = 0.2f;
+ btheme->tui.wcol_tool.roundness = 0.25f;
+ btheme->tui.wcol_tooltip.roundness = 0.2f;
+
+ for (ts = UI_THEMESPACE_START(btheme); ts != UI_THEMESPACE_END(btheme); ts++) {
+ /* XXX maybe remove show_back/show_header options? */
+ ts->panelcolors.show_back = ts->panelcolors.show_header = true;
+ rgba_char_args_set(ts->panelcolors.back, 128, 128, 128, 255);
+ rgba_char_args_set(ts->panelcolors.header, 97, 97, 97, 255);
+ }
+ }
+ }
-
if (U.pixelsize == 0.0f)
U.pixelsize = 1.0f;
More information about the Bf-blender-cvs
mailing list