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:
authorCampbell Barton <ideasman42@gmail.com>2018-06-12 11:11:32 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-06-12 11:42:49 +0300
commit4bf331c0fcfebf211443bdd15181a334cdf1566b (patch)
tree5d2188bdb5799f8130212c6683930c60fb7cc379 /source/blender/editors/interface/interface_panel.c
parent3937e8fbc3bb6ec7bdd3caad26e4e8a504ee5100 (diff)
UI: Initial persistent floating redo panel
This is the first step to moving redo out of the top-bar, see: T55039 - Support for floating panels in the ScrArea has been added. - A new region type RGN_TYPE_HUD is used for floating settings input. - Only one HUD should be visible at a time. - Currently HUD regions are only visible for 3D view and image space types. - There are currently some remaining glitches with hide/show that need further investigation.
Diffstat (limited to 'source/blender/editors/interface/interface_panel.c')
-rw-r--r--source/blender/editors/interface/interface_panel.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c
index dbdf2a0863c..e383ae42f8c 100644
--- a/source/blender/editors/interface/interface_panel.c
+++ b/source/blender/editors/interface/interface_panel.c
@@ -110,7 +110,7 @@ typedef struct uiHandlePanelData {
int startsizex, startsizey;
} uiHandlePanelData;
-static int get_panel_real_size_y(Panel *pa);
+static int get_panel_real_size_y(const Panel *pa);
static void panel_activate_state(const bContext *C, Panel *pa, uiHandlePanelState state);
/*********************** space specific code ************************/
@@ -855,7 +855,7 @@ void ui_draw_aligned_panel(uiStyle *style, uiBlock *block, const rcti *rect, con
/************************** panel alignment *************************/
-static int get_panel_header(Panel *pa)
+static int get_panel_header(const Panel *pa)
{
if (pa->type && (pa->type->flag & PNL_NO_HEADER))
return 0;
@@ -863,7 +863,7 @@ static int get_panel_header(Panel *pa)
return PNL_HEADER;
}
-static int get_panel_size_y(Panel *pa)
+static int get_panel_size_y(const Panel *pa)
{
if (pa->type && (pa->type->flag & PNL_NO_HEADER))
return pa->sizey;
@@ -871,7 +871,7 @@ static int get_panel_size_y(Panel *pa)
return PNL_HEADER + pa->sizey;
}
-static int get_panel_real_size_y(Panel *pa)
+static int get_panel_real_size_y(const Panel *pa)
{
int sizey = (pa->flag & PNL_CLOSED) ? 0 : pa->sizey;
@@ -881,6 +881,11 @@ static int get_panel_real_size_y(Panel *pa)
return PNL_HEADER + sizey;
}
+int UI_panel_size_y(const Panel *pa)
+{
+ return get_panel_real_size_y(pa);
+}
+
/* this function is needed because uiBlock and Panel itself don't
* change sizey or location when closed */
static int get_panel_real_ofsy(Panel *pa)
@@ -1596,6 +1601,10 @@ static void ui_handle_panel_header(const bContext *C, uiBlock *block, int mx, in
ED_region_tag_redraw(ar);
}
else if (show_drag && BLI_rctf_isect_x(&rect_drag, mx)) {
+ /* XXX, for now don't allow dragging in floating windows yet. */
+ if (ar->alignment == RGN_ALIGN_FLOAT) {
+ return;
+ }
panel_activate_state(C, block->panel, PANEL_STATE_DRAG);
}
else if (show_pin && BLI_rctf_isect_x(&rect_pin, mx)) {