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:
authorSeverin <eiseljulian@gmail.com>2019-01-04 23:40:16 +0300
committerJulian Eisel <eiseljulian@gmail.com>2019-01-05 00:18:23 +0300
commita77b63c56943ebd0046f738e6abbea4c85dc65b6 (patch)
tree173dddb28838298d2319f4f062586ba8985728c1 /source/blender/editors/screen/screen_ops.c
parent4b486eaec9763108fd471b7705133c45116df966 (diff)
UI: Preferences Redesign Part 2
(Part 1 was 00963afc14978b) Does the following changes visible to users: * Use panels and sub-panels for more structured & logical grouping * Re-organized options more logically than before (see images in D4148) * Use flow layout (single column by default). * New layout uses horizontal margin if there's enough space. * Change size of Preferences window to suit new layout. * Move keymap related options from "Input" into own section. * Own, left-bottom aligned region for Save Preferences button. * Adjustments of names, tooltips & icons. * Move buttons from header into the main region (except editor switch). * Hide Preferences header when opened in temporary window. * Use full area width for header. * Don't use slider but regular number widget for UI scale. * Gray out animation player path option if player isn't "Custom" Internal changes: * Rearrange RNA properties to match changed UI structure. * Introduces new "EXECUTE" region type, see reasoning in D3982. * Changes to panel layout and AZone code for dynamic panel region. * Bumps subversion and does versioning for new regions. RNA changes are documented in the release notes: https://wiki.blender.org/wiki/Reference/Release_Notes/2.80/Python_API/Preferences_API Design & implementation mostly done by @billreynish and myself. I recommend checking out the screenshots posted by William: https://developer.blender.org/D4148#93787 Reviewed By: brecht Maniphest Tasks: T54115 Differential Revision: https://developer.blender.org/D4148
Diffstat (limited to 'source/blender/editors/screen/screen_ops.c')
-rw-r--r--source/blender/editors/screen/screen_ops.c51
1 files changed, 45 insertions, 6 deletions
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c
index d41bf8d937b..62b4db94937 100644
--- a/source/blender/editors/screen/screen_ops.c
+++ b/source/blender/editors/screen/screen_ops.c
@@ -798,6 +798,32 @@ static AZone *area_actionzone_refresh_xy(ScrArea *sa, const int xy[2], const boo
}
}
}
+ else if (!test_only && !IS_EQF(az->alpha, 0.0f)) {
+ bool changed = false;
+
+ if (az->type == AZONE_FULLSCREEN) {
+ az->alpha = 0.0f;
+ changed = true;
+ }
+ else if (az->type == AZONE_REGION_SCROLL) {
+ if (az->direction == AZ_SCROLL_VERT) {
+ az->alpha = az->ar->v2d.alpha_vert = 0;
+ changed = true;
+ }
+ else if (az->direction == AZ_SCROLL_HOR) {
+ az->alpha = az->ar->v2d.alpha_hor = 0;
+ changed = true;
+ }
+ else {
+ BLI_assert(0);
+ }
+ }
+
+ if (changed) {
+ sa->flag &= ~AREA_FLAG_ACTIONZONES_UPDATE;
+ ED_area_tag_redraw_no_rebuild(sa);
+ }
+ }
}
return az;
@@ -808,7 +834,7 @@ AZone *ED_area_actionzone_find_xy(ScrArea *sa, const int xy[2])
return area_actionzone_refresh_xy(sa, xy, true);
}
-AZone *ED_area_actionzone_refresh_xy(ScrArea *sa, const int xy[2])
+AZone *ED_area_azones_update(ScrArea *sa, const int xy[2])
{
return area_actionzone_refresh_xy(sa, xy, false);
}
@@ -2382,8 +2408,12 @@ static int region_scale_modal(bContext *C, wmOperator *op, const wmEvent *event)
if (!(rmd->ar->flag & RGN_FLAG_HIDDEN))
region_scale_toggle_hidden(C, rmd);
}
- else if (rmd->ar->flag & RGN_FLAG_HIDDEN)
+ else if (rmd->ar->flag & RGN_FLAG_HIDDEN) {
region_scale_toggle_hidden(C, rmd);
+ }
+ else if (rmd->ar->flag & RGN_FLAG_DYNAMIC_SIZE) {
+ rmd->ar->sizex = rmd->origval;
+ }
}
else {
int maxsize = region_scale_get_maxsize(rmd);
@@ -2411,10 +2441,15 @@ static int region_scale_modal(bContext *C, wmOperator *op, const wmEvent *event)
if (!(rmd->ar->flag & RGN_FLAG_HIDDEN))
region_scale_toggle_hidden(C, rmd);
}
- else if (maxsize > 0 && (rmd->ar->sizey > maxsize))
+ else if (maxsize > 0 && (rmd->ar->sizey > maxsize)) {
rmd->ar->sizey = maxsize;
- else if (rmd->ar->flag & RGN_FLAG_HIDDEN)
+ }
+ else if (rmd->ar->flag & RGN_FLAG_HIDDEN) {
region_scale_toggle_hidden(C, rmd);
+ }
+ else if (rmd->ar->flag & RGN_FLAG_DYNAMIC_SIZE) {
+ rmd->ar->sizey = rmd->origval;
+ }
}
ED_area_tag_redraw(rmd->sa);
WM_event_add_notifier(C, NC_SCREEN | NA_EDITED, NULL);
@@ -4349,11 +4384,15 @@ static void SCREEN_OT_back_to_previous(struct wmOperatorType *ot)
static int userpref_show_invoke(bContext *C, wmOperator *op, const wmEvent *event)
{
- int sizex = (800 + UI_NAVIGATION_REGION_WIDTH) * UI_DPI_FAC;
- int sizey = 500 * UI_DPI_FAC;
+ int sizex = (500 + UI_NAVIGATION_REGION_WIDTH) * UI_DPI_FAC;
+ int sizey = 520 * UI_DPI_FAC;
/* changes context! */
if (WM_window_open_temp(C, event->x, event->y, sizex, sizey, WM_WINDOW_USERPREFS) != NULL) {
+ /* The header only contains the editor switcher and looks empty. So hiding in the temp window makes sense. */
+ ScrArea *area = CTX_wm_area(C);
+ ARegion *region = BKE_area_find_region_type(area, RGN_TYPE_HEADER);
+ region->flag |= RGN_FLAG_HIDDEN;
return OPERATOR_FINISHED;
}
else {