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:
-rw-r--r--source/blender/editors/interface/interface.c2
-rw-r--r--source/blender/editors/interface/interface_style.c2
-rw-r--r--source/blender/editors/interface/view2d.c9
-rw-r--r--source/blender/editors/interface/view2d_ops.c11
-rw-r--r--source/blender/makesdna/DNA_userdef_types.h4
-rw-r--r--source/blender/makesrna/intern/rna_userdef.c4
6 files changed, 23 insertions, 9 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index 391be4ba591..6f86e3e809a 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -1615,7 +1615,7 @@ uiBlock *uiBeginBlock(const bContext *C, ARegion *region, const char *name, shor
block= MEM_callocN(sizeof(uiBlock), "uiBlock");
block->active= 1;
block->dt= dt;
- block->evil_C= C; // XXX
+ block->evil_C= (void*)C; // XXX
BLI_strncpy(block->name, name, sizeof(block->name));
if(region)
diff --git a/source/blender/editors/interface/interface_style.c b/source/blender/editors/interface/interface_style.c
index 9ff1f2d6b29..83eb8a32701 100644
--- a/source/blender/editors/interface/interface_style.c
+++ b/source/blender/editors/interface/interface_style.c
@@ -89,6 +89,8 @@ static uiStyle *ui_style_new(ListBase *styles, const char *name)
BLI_addtail(styles, style);
BLI_strncpy(style->name, name, MAX_STYLE_NAME);
+ style->panelzoom= 1.0;
+
style->paneltitle.uifont_id= UIFONT_DEFAULT;
style->paneltitle.points= 13;
style->paneltitle.shadow= 5;
diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c
index fcac1987fdc..e0e2af5472d 100644
--- a/source/blender/editors/interface/view2d.c
+++ b/source/blender/editors/interface/view2d.c
@@ -155,7 +155,8 @@ static void view2d_masks(View2D *v2d)
void UI_view2d_region_reinit(View2D *v2d, short type, int winx, int winy)
{
short tot_changed= 0;
-
+ uiStyle *style= U.uistyles.first;
+
/* initialise data if there is a need for such */
if ((v2d->flag & V2D_IS_INITIALISED) == 0) {
/* set initialised flag so that View2D doesn't get reinitialised next time again */
@@ -250,7 +251,11 @@ void UI_view2d_region_reinit(View2D *v2d, short type, int winx, int winy)
v2d->tot.ymax= 0.0f;
v2d->tot.ymin= -winy;
- v2d->cur= v2d->tot;
+ v2d->cur.xmin= 0.0f;
+ v2d->cur.xmax= winx*style->panelzoom;
+
+ v2d->cur.ymax= 0.0f;
+ v2d->cur.ymin= -winy*style->panelzoom;
}
break;
diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c
index 101d89da618..54ab0d9ef61 100644
--- a/source/blender/editors/interface/view2d_ops.c
+++ b/source/blender/editors/interface/view2d_ops.c
@@ -1273,6 +1273,7 @@ void VIEW2D_OT_scroller_activate(wmOperatorType *ot)
static int reset_exec(bContext *C, wmOperator *op)
{
+ uiStyle *style= U.uistyles.first;
ARegion *ar= CTX_wm_region(C);
View2D *v2d= &ar->v2d;
int winx, winy;
@@ -1283,26 +1284,26 @@ static int reset_exec(bContext *C, wmOperator *op)
v2d->cur.xmax= v2d->cur.xmin + winx;
v2d->cur.ymax= v2d->cur.ymin + winy;
-
+
/* align */
if(v2d->align) {
/* posx and negx flags are mutually exclusive, so watch out */
if ((v2d->align & V2D_ALIGN_NO_POS_X) && !(v2d->align & V2D_ALIGN_NO_NEG_X)) {
v2d->cur.xmax= 0.0f;
- v2d->cur.xmin= v2d->winx;
+ v2d->cur.xmin= v2d->winx*style->panelzoom;
}
else if ((v2d->align & V2D_ALIGN_NO_NEG_X) && !(v2d->align & V2D_ALIGN_NO_POS_X)) {
- v2d->cur.xmax= v2d->cur.xmax - v2d->cur.xmin;
+ v2d->cur.xmax= (v2d->cur.xmax - v2d->cur.xmin)*style->panelzoom;
v2d->cur.xmin= 0.0f;
}
/* - posx and negx flags are mutually exclusive, so watch out */
if ((v2d->align & V2D_ALIGN_NO_POS_Y) && !(v2d->align & V2D_ALIGN_NO_NEG_Y)) {
v2d->cur.ymax= 0.0f;
- v2d->cur.ymin= -v2d->winy;
+ v2d->cur.ymin= -v2d->winy*style->panelzoom;
}
else if ((v2d->align & V2D_ALIGN_NO_NEG_Y) && !(v2d->align & V2D_ALIGN_NO_POS_Y)) {
- v2d->cur.ymax= v2d->cur.ymax - v2d->cur.ymin;
+ v2d->cur.ymax= (v2d->cur.ymax - v2d->cur.ymin)*style->panelzoom;
v2d->cur.ymin= 0.0f;
}
}
diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h
index dec3fde8f53..fcb10a33fda 100644
--- a/source/blender/makesdna/DNA_userdef_types.h
+++ b/source/blender/makesdna/DNA_userdef_types.h
@@ -92,6 +92,8 @@ typedef struct uiStyle {
uiFontStyle widgetlabel;
uiFontStyle widget;
+ float panelzoom;
+
short minlabelchars; /* in characters */
short minwidgetchars; /* in characters */
@@ -103,7 +105,7 @@ typedef struct uiStyle {
short panelspace;
short panelouter;
- short pad[3];
+ short pad[1];
} uiStyle;
typedef struct uiWidgetColors {
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index a2bc652ad1a..03bd0c9cfe2 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -174,6 +174,10 @@ static void rna_def_userdef_theme_ui_style(BlenderRNA *brna)
RNA_def_struct_sdna(srna, "uiStyle");
RNA_def_struct_ui_text(srna, "Style", "Theme settings for style sets.");
+ prop= RNA_def_property(srna, "panelzoom", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_range(prop, 0.5, 2.0);
+ RNA_def_property_ui_text(prop, "Panel Zoom", "Default zoom level for panel areas.");
+
prop= RNA_def_property(srna, "paneltitle", PROP_POINTER, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "paneltitle");
RNA_def_property_struct_type(prop, "ThemeFontStyle");