2011-02-23 10:52:22 +00:00
|
|
|
/*
|
2008-01-07 18:03:41 +00:00
|
|
|
* ***** BEGIN GPL LICENSE BLOCK *****
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software Foundation,
|
2010-02-12 13:34:04 +00:00
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2008-01-07 18:03:41 +00:00
|
|
|
*
|
|
|
|
* The Original Code is Copyright (C) 2008 Blender Foundation.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Contributor(s): Blender Foundation
|
|
|
|
*
|
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
|
|
|
*/
|
|
|
|
|
2011-02-27 20:29:51 +00:00
|
|
|
/** \file blender/editors/screen/area.c
|
|
|
|
* \ingroup edscr
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2008-01-07 18:03:41 +00:00
|
|
|
#include <string.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
#include "MEM_guardedalloc.h"
|
|
|
|
|
UI: Layout Engine
* Buttons are now created first, and after that the layout is computed.
This means the layout engine now works at button level, and makes it
easier to write templates. Otherwise you had to store all info and
create the buttons later.
* Added interface_templates.c as a separate file to put templates in.
These can contain regular buttons, and can be put in a Free layout,
which means you can specify manual coordinates, but still get nested
correct inside other layouts.
* API was changed to allow better nesting. Previously items were added
in the last added layout specifier, i.e. one level up in the layout
hierarchy. This doesn't work well in always, so now when creating things
like rows or columns it always returns a layout which you have to add
the items in. All py scripts were updated to follow this.
* Computing the layout now goes in two passes, first estimating the
required width/height of all nested layouts, and then in the second
pass using the results of that to decide on the actual locations.
* Enum and array buttons now follow the direction of the layout, i.e.
they are vertical or horizontal depending if they are in a column or row.
* Color properties now get a color picker, and only get the additional
RGB sliders with Expand=True.
* File/directory string properties now get a button next to them for
opening the file browse, though this is not implemented yet.
* Layout items can now be aligned, set align=True when creating a column,
row, etc.
* Buttons now get a minimum width of one icon (avoids squashing icon
buttons).
* Moved some more space variables into Style.
2009-05-15 11:19:59 +00:00
|
|
|
#include "DNA_userdef_types.h"
|
|
|
|
|
2008-01-07 18:03:41 +00:00
|
|
|
#include "BLI_blenlib.h"
|
2009-11-10 20:43:45 +00:00
|
|
|
#include "BLI_math.h"
|
2011-01-07 18:36:47 +00:00
|
|
|
#include "BLI_utildefines.h"
|
2013-12-04 11:54:56 +11:00
|
|
|
#include "BLI_linklist_stack.h"
|
2008-01-07 18:03:41 +00:00
|
|
|
|
2011-06-15 08:28:56 +00:00
|
|
|
|
2008-12-18 02:56:48 +00:00
|
|
|
#include "BKE_context.h"
|
2008-12-21 17:18:36 +00:00
|
|
|
#include "BKE_global.h"
|
2008-01-07 18:03:41 +00:00
|
|
|
#include "BKE_screen.h"
|
|
|
|
|
2013-06-09 16:18:23 +00:00
|
|
|
#include "RNA_access.h"
|
|
|
|
#include "RNA_types.h"
|
|
|
|
|
2008-01-07 18:03:41 +00:00
|
|
|
#include "WM_api.h"
|
|
|
|
#include "WM_types.h"
|
|
|
|
#include "wm_subwindow.h"
|
|
|
|
|
2008-12-19 12:48:30 +00:00
|
|
|
#include "ED_screen.h"
|
|
|
|
#include "ED_screen_types.h"
|
2010-08-06 18:11:49 +00:00
|
|
|
#include "ED_space_api.h"
|
2008-12-19 12:48:30 +00:00
|
|
|
|
2008-01-07 18:03:41 +00:00
|
|
|
#include "BIF_gl.h"
|
|
|
|
#include "BIF_glutil.h"
|
2009-05-05 23:10:32 +00:00
|
|
|
#include "BLF_api.h"
|
2008-01-07 18:03:41 +00:00
|
|
|
|
2015-04-20 19:57:57 +02:00
|
|
|
#include "IMB_imbuf.h"
|
|
|
|
#include "IMB_imbuf_types.h"
|
|
|
|
|
2008-12-10 13:56:54 +00:00
|
|
|
#include "UI_interface.h"
|
2014-10-14 15:05:44 -03:00
|
|
|
#include "UI_interface_icons.h"
|
Port of part of the Interface code to 2.50.
This is based on the current trunk version, so these files should not need
merges. There's two things (clipboard and intptr_t) that are missing in 2.50
and commented out with XXX 2.48, these can be enabled again once trunk is
merged into this branch.
Further this is not all interface code, there are many parts commented out:
* interface.c: nearly all button types, missing: links, chartab, keyevent.
* interface_draw.c: almost all code, with some small exceptions.
* interface_ops.c: this replaces ui_do_but and uiDoBlocks with two operators,
making it non-blocking.
* interface_regions: this is a part of interface.c, split off, contains code to
create regions for tooltips, menus, pupmenu (that one is crashing currently),
color chooser, basically regions with buttons which is fairly independent of
core interface code.
* interface_panel.c and interface_icons.c: not ported over, so no panels and
icons yet. Panels should probably become (free floating) regions?
* text.c: (formerly language.c) for drawing text and translation. this works
but is using bad globals still and could be cleaned up.
Header Files:
* ED_datafiles.h now has declarations for datatoc_ files, so those extern
declarations can be #included instead of repeated.
* The user interface code is in UI_interface.h and other UI_* files.
Core:
* The API for creating blocks, buttons, etc is nearly the same still. Blocks
are now created per region instead of per area.
* The code was made non-blocking, which means that any changes and redraws
should be possible while editing a button. That means though that we need
some sort of persistence even though the blender model is to recreate buttons
for each redraw. So when a new block is created, some matching happens to
find out which buttons correspond to buttons in the previously created block,
and for activated buttons some data is then copied over to the new button.
* Added UI_init/UI_init_userdef/UI_exit functions that should initialize code
in this module, instead of multiple function calls in the windowmanager.
* Removed most static/globals from interface.c.
* Removed UIafterfunc_ I don't think it's needed anymore, and not sure how it
would integrate here?
* Currently only full window redraws are used, this should become per region
and maybe per button later.
Operators:
* Events are currently handled through two operators: button activate and menu
handle. Operators may not be the best way to implement this, since there are
currently some issues with events being missed, but they can become a special
handler type instead, this should not be a big change.
* The button activate operator runs as long as a button is active, and will
handle all interaction with that button until the button is not activated
anymore. This means clicking, text editing, number dragging, opening menu
blocks, etc.
* Since this operator has to be non-blocking, the ui_do_but code needed to made
non-blocking. That means variables that were previously on the stack, now
need to be stored away in a struct such that they can be accessed again when
the operator receives more events.
* Additionally the place in the ui_do_but code indicated the state, now that
needs to be set explicit in order to handle the right events in the right
state. So an activated button can be in one of these states: init, highlight,
wait_flash, wait_release, wait_key_event, num_editing, text_editing,
text_selecting, block_open, exit.
* For each button type an ui_apply_but_* function has also been separated out
from ui_do_but. This makes it possible to continuously apply the button as
text is being typed for example, and there is an option in the code to enable
this. Since the code non-blocking and can deal with the button being deleted
even, it should be safe to do this.
* When editing text, dragging numbers, etc, the actual data (but->poin) is not
being edited, since that would mean data is being edited without correct
updates happening, while some other part of blender may be accessing that
data in the meantime. So data values, strings, vectors are written to a
temporary location and only flush in the apply function.
Regions:
* Menus, color chooser, tooltips etc all create screen level regions. Such menu
blocks give a handle to the button that creates it, which will contain the
results of the menu block once a MESSAGE event is received from that menu
block.
* For this type of menu block the coordinates used to be in window space. They
are still created that way and ui_positionblock still works with window
coordinates, but after that the block and buttons are brought back to region
coordinates since these are now contained in a region.
* The flush/overdraw frontbuffer drawing code was removed, the windowmanager
should have enough information with these screen level regions to have full
control over what gets drawn when and to then do correct compositing.
Testing:
* The header in the time space currently has some buttons to test the UI code.
2008-11-11 18:31:32 +00:00
|
|
|
#include "UI_resources.h"
|
2008-12-10 13:56:54 +00:00
|
|
|
#include "UI_view2d.h"
|
Port of part of the Interface code to 2.50.
This is based on the current trunk version, so these files should not need
merges. There's two things (clipboard and intptr_t) that are missing in 2.50
and commented out with XXX 2.48, these can be enabled again once trunk is
merged into this branch.
Further this is not all interface code, there are many parts commented out:
* interface.c: nearly all button types, missing: links, chartab, keyevent.
* interface_draw.c: almost all code, with some small exceptions.
* interface_ops.c: this replaces ui_do_but and uiDoBlocks with two operators,
making it non-blocking.
* interface_regions: this is a part of interface.c, split off, contains code to
create regions for tooltips, menus, pupmenu (that one is crashing currently),
color chooser, basically regions with buttons which is fairly independent of
core interface code.
* interface_panel.c and interface_icons.c: not ported over, so no panels and
icons yet. Panels should probably become (free floating) regions?
* text.c: (formerly language.c) for drawing text and translation. this works
but is using bad globals still and could be cleaned up.
Header Files:
* ED_datafiles.h now has declarations for datatoc_ files, so those extern
declarations can be #included instead of repeated.
* The user interface code is in UI_interface.h and other UI_* files.
Core:
* The API for creating blocks, buttons, etc is nearly the same still. Blocks
are now created per region instead of per area.
* The code was made non-blocking, which means that any changes and redraws
should be possible while editing a button. That means though that we need
some sort of persistence even though the blender model is to recreate buttons
for each redraw. So when a new block is created, some matching happens to
find out which buttons correspond to buttons in the previously created block,
and for activated buttons some data is then copied over to the new button.
* Added UI_init/UI_init_userdef/UI_exit functions that should initialize code
in this module, instead of multiple function calls in the windowmanager.
* Removed most static/globals from interface.c.
* Removed UIafterfunc_ I don't think it's needed anymore, and not sure how it
would integrate here?
* Currently only full window redraws are used, this should become per region
and maybe per button later.
Operators:
* Events are currently handled through two operators: button activate and menu
handle. Operators may not be the best way to implement this, since there are
currently some issues with events being missed, but they can become a special
handler type instead, this should not be a big change.
* The button activate operator runs as long as a button is active, and will
handle all interaction with that button until the button is not activated
anymore. This means clicking, text editing, number dragging, opening menu
blocks, etc.
* Since this operator has to be non-blocking, the ui_do_but code needed to made
non-blocking. That means variables that were previously on the stack, now
need to be stored away in a struct such that they can be accessed again when
the operator receives more events.
* Additionally the place in the ui_do_but code indicated the state, now that
needs to be set explicit in order to handle the right events in the right
state. So an activated button can be in one of these states: init, highlight,
wait_flash, wait_release, wait_key_event, num_editing, text_editing,
text_selecting, block_open, exit.
* For each button type an ui_apply_but_* function has also been separated out
from ui_do_but. This makes it possible to continuously apply the button as
text is being typed for example, and there is an option in the code to enable
this. Since the code non-blocking and can deal with the button being deleted
even, it should be safe to do this.
* When editing text, dragging numbers, etc, the actual data (but->poin) is not
being edited, since that would mean data is being edited without correct
updates happening, while some other part of blender may be accessing that
data in the meantime. So data values, strings, vectors are written to a
temporary location and only flush in the apply function.
Regions:
* Menus, color chooser, tooltips etc all create screen level regions. Such menu
blocks give a handle to the button that creates it, which will contain the
results of the menu block once a MESSAGE event is received from that menu
block.
* For this type of menu block the coordinates used to be in window space. They
are still created that way and ui_positionblock still works with window
coordinates, but after that the block and buttons are brought back to region
coordinates since these are now contained in a region.
* The flush/overdraw frontbuffer drawing code was removed, the windowmanager
should have enough information with these screen level regions to have full
control over what gets drawn when and to then do correct compositing.
Testing:
* The header in the time space currently has some buttons to test the UI code.
2008-11-11 18:31:32 +00:00
|
|
|
|
2008-01-07 18:03:41 +00:00
|
|
|
#include "screen_intern.h"
|
|
|
|
|
2013-03-11 20:27:38 +00:00
|
|
|
extern void ui_draw_anti_tria(float x1, float y1, float x2, float y2, float x3, float y3); /* xxx temp */
|
|
|
|
|
2008-01-07 18:03:41 +00:00
|
|
|
/* general area and region code */
|
|
|
|
|
2015-06-30 15:31:55 +10:00
|
|
|
static void region_draw_emboss(const ARegion *ar, const rcti *scirct)
|
2008-01-07 18:03:41 +00:00
|
|
|
{
|
2.5
Summary of ain features:
- Themes and Styles are now editable.
- CTRL+U "Save user defaults" now goes to new .B25.blend, so you
can use 2.4x and 2.5x next to each other. If B25 doesn't exist, it
reads the regular .B.blend
- Press Tkey in 3d window for (unfinished) toolbar WIP. It now only
shows the last operator, if appropriate.
Nkey properties moved to the other side.
A lot of work was done on removing old themes for good and properly
getting it work with the 2.5 region system. Here's some notes;
- Buttons now all have a complete set of colors, based on button classifications
(See outliner -> user prefs -> Interface
- Theme colors have been extended with basic colors for region types.
Currently colors are defined for Window, Header, List/Channels and
for Button/Tool views.
The screen manager handles this btw, so a TH_BACK will always pick the
right backdrop color.
- Menu backdrops are in in Button theme colors. Floating Panels will be in
the per-space type Themes.
- Styles were added in RNA too, but only for the font settings now.
Only Panel font, widget font and widget-label work now. The 'group label'
will be for templates mostly.
Style settings will be expanded with spacing defaults, label conventions,
etc.
- Label text colors are stored in per-space Theme too, to make sure they fit.
Same goes for Panel title color.
Note that 'shadow' for fonts can conflict with text colors; shadow color is
currently stored in Style... shadow code needs a bit of work still.
2009-04-27 13:44:11 +00:00
|
|
|
rcti rect;
|
2008-01-07 18:03:41 +00:00
|
|
|
|
2.5
Summary of ain features:
- Themes and Styles are now editable.
- CTRL+U "Save user defaults" now goes to new .B25.blend, so you
can use 2.4x and 2.5x next to each other. If B25 doesn't exist, it
reads the regular .B.blend
- Press Tkey in 3d window for (unfinished) toolbar WIP. It now only
shows the last operator, if appropriate.
Nkey properties moved to the other side.
A lot of work was done on removing old themes for good and properly
getting it work with the 2.5 region system. Here's some notes;
- Buttons now all have a complete set of colors, based on button classifications
(See outliner -> user prefs -> Interface
- Theme colors have been extended with basic colors for region types.
Currently colors are defined for Window, Header, List/Channels and
for Button/Tool views.
The screen manager handles this btw, so a TH_BACK will always pick the
right backdrop color.
- Menu backdrops are in in Button theme colors. Floating Panels will be in
the per-space type Themes.
- Styles were added in RNA too, but only for the font settings now.
Only Panel font, widget font and widget-label work now. The 'group label'
will be for templates mostly.
Style settings will be expanded with spacing defaults, label conventions,
etc.
- Label text colors are stored in per-space Theme too, to make sure they fit.
Same goes for Panel title color.
Note that 'shadow' for fonts can conflict with text colors; shadow color is
currently stored in Style... shadow code needs a bit of work still.
2009-04-27 13:44:11 +00:00
|
|
|
/* translate scissor rect to region space */
|
2012-03-24 02:51:46 +00:00
|
|
|
rect.xmin = scirct->xmin - ar->winrct.xmin;
|
|
|
|
rect.ymin = scirct->ymin - ar->winrct.ymin;
|
|
|
|
rect.xmax = scirct->xmax - ar->winrct.xmin;
|
|
|
|
rect.ymax = scirct->ymax - ar->winrct.ymin;
|
2008-01-07 18:03:41 +00:00
|
|
|
|
|
|
|
/* set transp line */
|
2012-04-29 17:55:54 +00:00
|
|
|
glEnable(GL_BLEND);
|
2012-04-29 17:11:40 +00:00
|
|
|
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
2008-01-07 18:03:41 +00:00
|
|
|
|
|
|
|
/* right */
|
2012-04-29 15:47:02 +00:00
|
|
|
glColor4ub(0, 0, 0, 30);
|
2.5
Summary of ain features:
- Themes and Styles are now editable.
- CTRL+U "Save user defaults" now goes to new .B25.blend, so you
can use 2.4x and 2.5x next to each other. If B25 doesn't exist, it
reads the regular .B.blend
- Press Tkey in 3d window for (unfinished) toolbar WIP. It now only
shows the last operator, if appropriate.
Nkey properties moved to the other side.
A lot of work was done on removing old themes for good and properly
getting it work with the 2.5 region system. Here's some notes;
- Buttons now all have a complete set of colors, based on button classifications
(See outliner -> user prefs -> Interface
- Theme colors have been extended with basic colors for region types.
Currently colors are defined for Window, Header, List/Channels and
for Button/Tool views.
The screen manager handles this btw, so a TH_BACK will always pick the
right backdrop color.
- Menu backdrops are in in Button theme colors. Floating Panels will be in
the per-space type Themes.
- Styles were added in RNA too, but only for the font settings now.
Only Panel font, widget font and widget-label work now. The 'group label'
will be for templates mostly.
Style settings will be expanded with spacing defaults, label conventions,
etc.
- Label text colors are stored in per-space Theme too, to make sure they fit.
Same goes for Panel title color.
Note that 'shadow' for fonts can conflict with text colors; shadow color is
currently stored in Style... shadow code needs a bit of work still.
2009-04-27 13:44:11 +00:00
|
|
|
sdrawline(rect.xmax, rect.ymin, rect.xmax, rect.ymax);
|
2008-01-07 18:03:41 +00:00
|
|
|
|
|
|
|
/* bottom */
|
2012-04-29 15:47:02 +00:00
|
|
|
glColor4ub(0, 0, 0, 30);
|
2.5
Summary of ain features:
- Themes and Styles are now editable.
- CTRL+U "Save user defaults" now goes to new .B25.blend, so you
can use 2.4x and 2.5x next to each other. If B25 doesn't exist, it
reads the regular .B.blend
- Press Tkey in 3d window for (unfinished) toolbar WIP. It now only
shows the last operator, if appropriate.
Nkey properties moved to the other side.
A lot of work was done on removing old themes for good and properly
getting it work with the 2.5 region system. Here's some notes;
- Buttons now all have a complete set of colors, based on button classifications
(See outliner -> user prefs -> Interface
- Theme colors have been extended with basic colors for region types.
Currently colors are defined for Window, Header, List/Channels and
for Button/Tool views.
The screen manager handles this btw, so a TH_BACK will always pick the
right backdrop color.
- Menu backdrops are in in Button theme colors. Floating Panels will be in
the per-space type Themes.
- Styles were added in RNA too, but only for the font settings now.
Only Panel font, widget font and widget-label work now. The 'group label'
will be for templates mostly.
Style settings will be expanded with spacing defaults, label conventions,
etc.
- Label text colors are stored in per-space Theme too, to make sure they fit.
Same goes for Panel title color.
Note that 'shadow' for fonts can conflict with text colors; shadow color is
currently stored in Style... shadow code needs a bit of work still.
2009-04-27 13:44:11 +00:00
|
|
|
sdrawline(rect.xmin, rect.ymin, rect.xmax, rect.ymin);
|
2008-01-07 18:03:41 +00:00
|
|
|
|
|
|
|
/* top */
|
2012-04-29 15:47:02 +00:00
|
|
|
glColor4ub(255, 255, 255, 30);
|
2.5
Summary of ain features:
- Themes and Styles are now editable.
- CTRL+U "Save user defaults" now goes to new .B25.blend, so you
can use 2.4x and 2.5x next to each other. If B25 doesn't exist, it
reads the regular .B.blend
- Press Tkey in 3d window for (unfinished) toolbar WIP. It now only
shows the last operator, if appropriate.
Nkey properties moved to the other side.
A lot of work was done on removing old themes for good and properly
getting it work with the 2.5 region system. Here's some notes;
- Buttons now all have a complete set of colors, based on button classifications
(See outliner -> user prefs -> Interface
- Theme colors have been extended with basic colors for region types.
Currently colors are defined for Window, Header, List/Channels and
for Button/Tool views.
The screen manager handles this btw, so a TH_BACK will always pick the
right backdrop color.
- Menu backdrops are in in Button theme colors. Floating Panels will be in
the per-space type Themes.
- Styles were added in RNA too, but only for the font settings now.
Only Panel font, widget font and widget-label work now. The 'group label'
will be for templates mostly.
Style settings will be expanded with spacing defaults, label conventions,
etc.
- Label text colors are stored in per-space Theme too, to make sure they fit.
Same goes for Panel title color.
Note that 'shadow' for fonts can conflict with text colors; shadow color is
currently stored in Style... shadow code needs a bit of work still.
2009-04-27 13:44:11 +00:00
|
|
|
sdrawline(rect.xmin, rect.ymax, rect.xmax, rect.ymax);
|
2008-01-07 18:03:41 +00:00
|
|
|
|
|
|
|
/* left */
|
2012-04-29 15:47:02 +00:00
|
|
|
glColor4ub(255, 255, 255, 30);
|
2.5
Summary of ain features:
- Themes and Styles are now editable.
- CTRL+U "Save user defaults" now goes to new .B25.blend, so you
can use 2.4x and 2.5x next to each other. If B25 doesn't exist, it
reads the regular .B.blend
- Press Tkey in 3d window for (unfinished) toolbar WIP. It now only
shows the last operator, if appropriate.
Nkey properties moved to the other side.
A lot of work was done on removing old themes for good and properly
getting it work with the 2.5 region system. Here's some notes;
- Buttons now all have a complete set of colors, based on button classifications
(See outliner -> user prefs -> Interface
- Theme colors have been extended with basic colors for region types.
Currently colors are defined for Window, Header, List/Channels and
for Button/Tool views.
The screen manager handles this btw, so a TH_BACK will always pick the
right backdrop color.
- Menu backdrops are in in Button theme colors. Floating Panels will be in
the per-space type Themes.
- Styles were added in RNA too, but only for the font settings now.
Only Panel font, widget font and widget-label work now. The 'group label'
will be for templates mostly.
Style settings will be expanded with spacing defaults, label conventions,
etc.
- Label text colors are stored in per-space Theme too, to make sure they fit.
Same goes for Panel title color.
Note that 'shadow' for fonts can conflict with text colors; shadow color is
currently stored in Style... shadow code needs a bit of work still.
2009-04-27 13:44:11 +00:00
|
|
|
sdrawline(rect.xmin, rect.ymin, rect.xmin, rect.ymax);
|
2008-01-07 18:03:41 +00:00
|
|
|
|
2012-04-29 17:11:40 +00:00
|
|
|
glDisable(GL_BLEND);
|
2008-01-07 18:03:41 +00:00
|
|
|
}
|
|
|
|
|
2008-12-19 14:14:43 +00:00
|
|
|
void ED_region_pixelspace(ARegion *ar)
|
2.5: work on bringing back SpaceTime options
- RMB select, also with SHIFT
- RMB tweak for translate
- SHIFT+D dupli
- BKEY border select/deselect
- AKEY (de)select all
- XKEY delete
- GKEY grab
Added some XXX comments for future todos, especially for when other
spaces come back with time markers.
Also added ED_util for putting in all to-be-cleaned cruft
Context conflict: input methods for Markers can conflict with other
spacetypes. It was solved in pre-2.5 with manually tweaking it all over,
but I would prefer one keymap for all marker stuff. Needs some thinking...
could be solved with a boundbox check for bottom part of 2d window.
Tweak issue: both tweak styles are possible:
- Hold mouse button, move, operator ends on mouse release
- Hold mouse button, move, operator ends on mouse click
Problem is that modally handled operators use fixed keymaps... like ESC,
SPACE, ENTER, or press/release mousebutton for 'assign'. There's a lot
to say for making this all consistant, or become part of 1 general keymap?
Should also be possibe to define 'tweak' defaults for Tablet different
than for mouse...
2008-11-29 15:10:31 +00:00
|
|
|
{
|
2014-09-10 13:24:31 +10:00
|
|
|
wmOrtho2_region_pixelspace(ar);
|
2010-02-01 15:32:55 +00:00
|
|
|
glLoadIdentity();
|
2.5: work on bringing back SpaceTime options
- RMB select, also with SHIFT
- RMB tweak for translate
- SHIFT+D dupli
- BKEY border select/deselect
- AKEY (de)select all
- XKEY delete
- GKEY grab
Added some XXX comments for future todos, especially for when other
spaces come back with time markers.
Also added ED_util for putting in all to-be-cleaned cruft
Context conflict: input methods for Markers can conflict with other
spacetypes. It was solved in pre-2.5 with manually tweaking it all over,
but I would prefer one keymap for all marker stuff. Needs some thinking...
could be solved with a boundbox check for bottom part of 2d window.
Tweak issue: both tweak styles are possible:
- Hold mouse button, move, operator ends on mouse release
- Hold mouse button, move, operator ends on mouse click
Problem is that modally handled operators use fixed keymaps... like ESC,
SPACE, ENTER, or press/release mousebutton for 'assign'. There's a lot
to say for making this all consistant, or become part of 1 general keymap?
Should also be possibe to define 'tweak' defaults for Tablet different
than for mouse...
2008-11-29 15:10:31 +00:00
|
|
|
}
|
2008-01-07 18:03:41 +00:00
|
|
|
|
2009-01-04 17:45:54 +00:00
|
|
|
/* only exported for WM */
|
2013-06-24 22:41:33 +00:00
|
|
|
void ED_region_do_listen(bScreen *sc, ScrArea *sa, ARegion *ar, wmNotifier *note)
|
2008-01-07 18:03:41 +00:00
|
|
|
{
|
2008-01-10 17:38:17 +00:00
|
|
|
/* generic notes first */
|
2012-04-28 06:31:57 +00:00
|
|
|
switch (note->category) {
|
2009-02-07 10:00:46 +00:00
|
|
|
case NC_WM:
|
2012-05-08 15:43:59 +00:00
|
|
|
if (note->data == ND_FILEREAD)
|
2009-02-07 10:00:46 +00:00
|
|
|
ED_region_tag_redraw(ar);
|
|
|
|
break;
|
2008-12-27 16:09:56 +00:00
|
|
|
case NC_WINDOW:
|
2008-12-16 12:28:00 +00:00
|
|
|
ED_region_tag_redraw(ar);
|
2008-01-10 17:38:17 +00:00
|
|
|
break;
|
|
|
|
}
|
2010-04-06 09:07:39 +00:00
|
|
|
|
2012-03-24 06:38:07 +00:00
|
|
|
if (ar->type && ar->type->listener)
|
2013-06-24 22:41:33 +00:00
|
|
|
ar->type->listener(sc, sa, ar, note);
|
2008-01-07 18:03:41 +00:00
|
|
|
}
|
|
|
|
|
2009-01-04 17:45:54 +00:00
|
|
|
/* only exported for WM */
|
2013-06-24 22:41:33 +00:00
|
|
|
void ED_area_do_listen(bScreen *sc, ScrArea *sa, wmNotifier *note)
|
2009-01-04 17:45:54 +00:00
|
|
|
{
|
|
|
|
/* no generic notes? */
|
2012-03-24 06:38:07 +00:00
|
|
|
if (sa->type && sa->type->listener) {
|
2013-06-24 22:41:33 +00:00
|
|
|
sa->type->listener(sc, sa, note);
|
2009-01-04 17:45:54 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* only exported for WM */
|
|
|
|
void ED_area_do_refresh(bContext *C, ScrArea *sa)
|
|
|
|
{
|
|
|
|
/* no generic notes? */
|
2012-03-24 06:38:07 +00:00
|
|
|
if (sa->type && sa->type->refresh) {
|
2009-01-04 17:45:54 +00:00
|
|
|
sa->type->refresh(C, sa);
|
|
|
|
}
|
2014-04-01 11:34:00 +11:00
|
|
|
sa->do_refresh = false;
|
2009-01-04 17:45:54 +00:00
|
|
|
}
|
|
|
|
|
2015-04-25 01:29:53 +02:00
|
|
|
/**
|
|
|
|
* Action zones are only updated if the mouse is inside of them, but in some cases (currently only fullscreen icon)
|
|
|
|
* it might be needed to update their properties and redraw if the mouse isn't inside.
|
|
|
|
*/
|
|
|
|
void ED_area_azones_update(ScrArea *sa, const int mouse_xy[2])
|
|
|
|
{
|
|
|
|
AZone *az;
|
|
|
|
bool changed = false;
|
|
|
|
|
|
|
|
for (az = sa->actionzones.first; az; az = az->next) {
|
|
|
|
if (az->type == AZONE_FULLSCREEN) {
|
|
|
|
/* only if mouse is not hovering the azone */
|
|
|
|
if (BLI_rcti_isect_pt_v(&az->rect, mouse_xy) == false) {
|
|
|
|
az->alpha = 0.0f;
|
|
|
|
changed = true;
|
|
|
|
|
|
|
|
/* can break since currently only this is handled here */
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (changed) {
|
|
|
|
sa->flag &= ~AREA_FLAG_ACTIONZONES_UPDATE;
|
|
|
|
ED_area_tag_redraw(sa);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-10-14 15:05:44 -03:00
|
|
|
/**
|
|
|
|
* \brief Corner widget use for quitting fullscreen.
|
|
|
|
*/
|
|
|
|
static void area_draw_azone_fullscreen(short x1, short y1, short x2, short y2, float alpha)
|
|
|
|
{
|
|
|
|
int x = x2 - ((float) x2 - x1) * 0.5f / UI_DPI_FAC;
|
|
|
|
int y = y2 - ((float) y2 - y1) * 0.5f / UI_DPI_FAC;
|
|
|
|
|
|
|
|
/* adjust the icon distance from the corner */
|
|
|
|
x += 36.0f / UI_DPI_FAC;
|
|
|
|
y += 36.0f / UI_DPI_FAC;
|
|
|
|
|
|
|
|
/* draws from the left bottom corner of the icon */
|
|
|
|
x -= UI_DPI_ICON_SIZE;
|
|
|
|
y -= UI_DPI_ICON_SIZE;
|
|
|
|
|
|
|
|
alpha = min_ff(alpha, 0.75f);
|
|
|
|
|
|
|
|
UI_icon_draw_aspect(x, y, ICON_FULLSCREEN_EXIT, 0.7f / UI_DPI_FAC, alpha);
|
|
|
|
|
|
|
|
/* debug drawing :
|
|
|
|
* The click_rect is the same as defined in fullscreen_click_rcti_init
|
|
|
|
* Keep them both in sync */
|
|
|
|
|
|
|
|
if (G.debug_value == 1) {
|
|
|
|
rcti click_rect;
|
|
|
|
float icon_size = UI_DPI_ICON_SIZE + 7 * UI_DPI_FAC;
|
|
|
|
char alpha_debug = 255 * alpha;
|
|
|
|
|
|
|
|
BLI_rcti_init(&click_rect, x, x + icon_size, y, y + icon_size);
|
|
|
|
|
|
|
|
glColor4ub(255, 0, 0, alpha_debug);
|
|
|
|
fdrawbox(click_rect.xmin, click_rect.ymin, click_rect.xmax, click_rect.ymax);
|
|
|
|
glColor4ub(0, 255, 255, alpha_debug);
|
|
|
|
fdrawline(click_rect.xmin, click_rect.ymin, click_rect.xmax, click_rect.ymax);
|
|
|
|
fdrawline(click_rect.xmin, click_rect.ymax, click_rect.xmax, click_rect.ymin);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-08-11 00:05:57 +00:00
|
|
|
/**
|
|
|
|
* \brief Corner widgets use for dragging and splitting the view.
|
|
|
|
*/
|
2009-04-30 02:14:03 +00:00
|
|
|
static void area_draw_azone(short x1, short y1, short x2, short y2)
|
|
|
|
{
|
2011-11-16 20:36:06 +00:00
|
|
|
int dx = x2 - x1;
|
|
|
|
int dy = y2 - y1;
|
|
|
|
|
2013-12-04 09:23:29 +11:00
|
|
|
dx = copysign(ceilf(0.3f * abs(dx)), dx);
|
|
|
|
dy = copysign(ceilf(0.3f * abs(dy)), dy);
|
2011-11-16 20:36:06 +00:00
|
|
|
|
2011-11-19 22:05:18 +00:00
|
|
|
glEnable(GL_BLEND);
|
2011-11-16 20:36:06 +00:00
|
|
|
glEnable(GL_LINE_SMOOTH);
|
2009-04-30 02:14:03 +00:00
|
|
|
|
2010-07-05 03:02:57 +00:00
|
|
|
glColor4ub(255, 255, 255, 180);
|
2011-02-06 17:36:42 +00:00
|
|
|
fdrawline(x1, y2, x2, y1);
|
2010-07-05 03:02:57 +00:00
|
|
|
glColor4ub(255, 255, 255, 130);
|
2012-05-08 15:43:59 +00:00
|
|
|
fdrawline(x1, y2 - dy, x2 - dx, y1);
|
2010-07-05 03:02:57 +00:00
|
|
|
glColor4ub(255, 255, 255, 80);
|
2012-05-08 15:43:59 +00:00
|
|
|
fdrawline(x1, y2 - 2 * dy, x2 - 2 * dx, y1);
|
2009-04-30 02:14:03 +00:00
|
|
|
|
2010-07-05 03:02:57 +00:00
|
|
|
glColor4ub(0, 0, 0, 210);
|
2012-05-08 15:43:59 +00:00
|
|
|
fdrawline(x1, y2 + 1, x2 + 1, y1);
|
2010-07-05 03:02:57 +00:00
|
|
|
glColor4ub(0, 0, 0, 180);
|
2012-05-08 15:43:59 +00:00
|
|
|
fdrawline(x1, y2 - dy + 1, x2 - dx + 1, y1);
|
2010-07-05 03:02:57 +00:00
|
|
|
glColor4ub(0, 0, 0, 150);
|
2012-05-08 15:43:59 +00:00
|
|
|
fdrawline(x1, y2 - 2 * dy + 1, x2 - 2 * dx + 1, y1);
|
2009-04-30 02:14:03 +00:00
|
|
|
|
2011-11-16 20:36:06 +00:00
|
|
|
glDisable(GL_LINE_SMOOTH);
|
2011-11-19 22:05:18 +00:00
|
|
|
glDisable(GL_BLEND);
|
2011-11-16 20:36:06 +00:00
|
|
|
}
|
2009-09-12 23:56:30 +00:00
|
|
|
|
Todo item:
Closed regions didn't always draw the (+) icon right place, confusing
for users.
Next to that, I think this icon is using a bad metaphor or visual language,
Illustrated best if you close a header in outliner or buttons. Icons are
UI widgets, for screen/editor layouts different controls can be stylized.
My preference is something that aligns visually to the seperators between
regions; for testing and hacking pleasure I've added two quick versions,
a small tabbish thing and a triangle. Enable these with debug menu,
ALT+CTRL+D, values 1 or 2.
This is simply drawn with opengl now. An image for it can be made as well.
Previews:
http://www.blender.org/bf/closed_regions1.png
http://www.blender.org/bf/closed_regions2.png
http://www.blender.org/bf/closed_regions3.png
There's other design ideas to explore as well, like making region deviders
8-10 pixels wide, with a 'drag me' dot on it or so. That takes some screen
estate though, and will require to add big editor-dividers too...
Fun stuff for the mockup-mafia to check on, we have time :)
2011-06-30 15:02:03 +00:00
|
|
|
static void region_draw_azone_icon(AZone *az)
|
2.5
First version of region-scaling. WIP commit, so bear with me a while!
- All fixed sized regions have a small 'drag' widget, on the left or top.
(not yet for free-sized regions, like 4-split).
- Mouse-over on widget changes cursor and allows drag.
- Click on widget hides/reveals.
- Fun for test; 3d view header, if high enough, draws more rows of
buttons when width is too small.
The WIP stuff;
- It doesn't save yet in files, using the "minsize" variable of region
definitions, also means other similar areas show same sizes now.
- Definitions for pref size, min/max will be added.
- Properties panel in Fcurve window draws widget on wrong place when
hidden (subdiv system needs tweak)
- Widgets don't draw perfect yet, also needs further tweaks.
But, in general it's quite fun and usable. :) Many variatians are possible,
like for real tabs, or little icons, or just click-drag on edge.
The reason to first try the widget/tab variation:
- it re-uses the "Area Action Zone" code, widgets for layouting Screens
- it's visible, hotkey-only options for screen layouts are not preferred.
- distinguish clearly area-edges from region-edges this way. Having the
cursor change shape on every edge (and block input) is probably annoying
too... but that can be tested.
Later more!
2009-05-24 13:29:29 +00:00
|
|
|
{
|
2009-10-12 11:41:20 +00:00
|
|
|
GLUquadricObj *qobj = NULL;
|
2012-05-08 15:43:59 +00:00
|
|
|
short midx = az->x1 + (az->x2 - az->x1) / 2;
|
|
|
|
short midy = az->y1 + (az->y2 - az->y1) / 2;
|
Todo item:
Closed regions didn't always draw the (+) icon right place, confusing
for users.
Next to that, I think this icon is using a bad metaphor or visual language,
Illustrated best if you close a header in outliner or buttons. Icons are
UI widgets, for screen/editor layouts different controls can be stylized.
My preference is something that aligns visually to the seperators between
regions; for testing and hacking pleasure I've added two quick versions,
a small tabbish thing and a triangle. Enable these with debug menu,
ALT+CTRL+D, values 1 or 2.
This is simply drawn with opengl now. An image for it can be made as well.
Previews:
http://www.blender.org/bf/closed_regions1.png
http://www.blender.org/bf/closed_regions2.png
http://www.blender.org/bf/closed_regions3.png
There's other design ideas to explore as well, like making region deviders
8-10 pixels wide, with a 'drag me' dot on it or so. That takes some screen
estate though, and will require to add big editor-dividers too...
Fun stuff for the mockup-mafia to check on, we have time :)
2011-06-30 15:02:03 +00:00
|
|
|
|
2009-10-12 11:41:20 +00:00
|
|
|
qobj = gluNewQuadric();
|
|
|
|
|
2012-04-11 08:15:13 +00:00
|
|
|
glPushMatrix();
|
|
|
|
glTranslatef(midx, midy, 0.0);
|
2.5
First version of region-scaling. WIP commit, so bear with me a while!
- All fixed sized regions have a small 'drag' widget, on the left or top.
(not yet for free-sized regions, like 4-split).
- Mouse-over on widget changes cursor and allows drag.
- Click on widget hides/reveals.
- Fun for test; 3d view header, if high enough, draws more rows of
buttons when width is too small.
The WIP stuff;
- It doesn't save yet in files, using the "minsize" variable of region
definitions, also means other similar areas show same sizes now.
- Definitions for pref size, min/max will be added.
- Properties panel in Fcurve window draws widget on wrong place when
hidden (subdiv system needs tweak)
- Widgets don't draw perfect yet, also needs further tweaks.
But, in general it's quite fun and usable. :) Many variatians are possible,
like for real tabs, or little icons, or just click-drag on edge.
The reason to first try the widget/tab variation:
- it re-uses the "Area Action Zone" code, widgets for layouting Screens
- it's visible, hotkey-only options for screen layouts are not preferred.
- distinguish clearly area-edges from region-edges this way. Having the
cursor change shape on every edge (and block input) is probably annoying
too... but that can be tested.
Later more!
2009-05-24 13:29:29 +00:00
|
|
|
|
2009-09-12 23:56:30 +00:00
|
|
|
/* outlined circle */
|
|
|
|
glEnable(GL_LINE_SMOOTH);
|
|
|
|
|
|
|
|
glColor4f(1.f, 1.f, 1.f, 0.8f);
|
|
|
|
|
|
|
|
gluQuadricDrawStyle(qobj, GLU_FILL);
|
2012-04-29 17:11:40 +00:00
|
|
|
gluDisk(qobj, 0.0, 4.25f, 16, 1);
|
2.5
First version of region-scaling. WIP commit, so bear with me a while!
- All fixed sized regions have a small 'drag' widget, on the left or top.
(not yet for free-sized regions, like 4-split).
- Mouse-over on widget changes cursor and allows drag.
- Click on widget hides/reveals.
- Fun for test; 3d view header, if high enough, draws more rows of
buttons when width is too small.
The WIP stuff;
- It doesn't save yet in files, using the "minsize" variable of region
definitions, also means other similar areas show same sizes now.
- Definitions for pref size, min/max will be added.
- Properties panel in Fcurve window draws widget on wrong place when
hidden (subdiv system needs tweak)
- Widgets don't draw perfect yet, also needs further tweaks.
But, in general it's quite fun and usable. :) Many variatians are possible,
like for real tabs, or little icons, or just click-drag on edge.
The reason to first try the widget/tab variation:
- it re-uses the "Area Action Zone" code, widgets for layouting Screens
- it's visible, hotkey-only options for screen layouts are not preferred.
- distinguish clearly area-edges from region-edges this way. Having the
cursor change shape on every edge (and block input) is probably annoying
too... but that can be tested.
Later more!
2009-05-24 13:29:29 +00:00
|
|
|
|
2009-09-12 23:56:30 +00:00
|
|
|
glColor4f(0.2f, 0.2f, 0.2f, 0.9f);
|
|
|
|
|
|
|
|
gluQuadricDrawStyle(qobj, GLU_SILHOUETTE);
|
2012-04-29 17:11:40 +00:00
|
|
|
gluDisk(qobj, 0.0, 4.25f, 16, 1);
|
2009-09-12 23:56:30 +00:00
|
|
|
|
|
|
|
glDisable(GL_LINE_SMOOTH);
|
|
|
|
|
|
|
|
glPopMatrix();
|
|
|
|
gluDeleteQuadric(qobj);
|
|
|
|
|
|
|
|
/* + */
|
2012-05-08 15:43:59 +00:00
|
|
|
sdrawline(midx, midy - 2, midx, midy + 3);
|
|
|
|
sdrawline(midx - 2, midy, midx + 3, midy);
|
2.5
First version of region-scaling. WIP commit, so bear with me a while!
- All fixed sized regions have a small 'drag' widget, on the left or top.
(not yet for free-sized regions, like 4-split).
- Mouse-over on widget changes cursor and allows drag.
- Click on widget hides/reveals.
- Fun for test; 3d view header, if high enough, draws more rows of
buttons when width is too small.
The WIP stuff;
- It doesn't save yet in files, using the "minsize" variable of region
definitions, also means other similar areas show same sizes now.
- Definitions for pref size, min/max will be added.
- Properties panel in Fcurve window draws widget on wrong place when
hidden (subdiv system needs tweak)
- Widgets don't draw perfect yet, also needs further tweaks.
But, in general it's quite fun and usable. :) Many variatians are possible,
like for real tabs, or little icons, or just click-drag on edge.
The reason to first try the widget/tab variation:
- it re-uses the "Area Action Zone" code, widgets for layouting Screens
- it's visible, hotkey-only options for screen layouts are not preferred.
- distinguish clearly area-edges from region-edges this way. Having the
cursor change shape on every edge (and block input) is probably annoying
too... but that can be tested.
Later more!
2009-05-24 13:29:29 +00:00
|
|
|
}
|
|
|
|
|
2011-11-19 22:05:18 +00:00
|
|
|
static void draw_azone_plus(float x1, float y1, float x2, float y2)
|
|
|
|
{
|
2012-12-18 14:55:51 +00:00
|
|
|
float width = 0.1f * U.widget_unit;
|
Holiday coding log :)
Nice formatted version (pictures soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.66/Usability
Short list of main changes:
- Transparent region option (over main region), added code to blend in/out such panels.
- Min size window now 640 x 480
- Fixed DPI for ui - lots of cleanup and changes everywhere. Icon image need correct size still, layer-in-use icon needs remake.
- Macbook retina support, use command line --no-native-pixels to disable it
- Timeline Marker label was drawing wrong
- Trackpad and magic mouse: supports zoom (hold ctrl)
- Fix for splash position: removed ghost function and made window size update after creation immediate
- Fast undo buffer save now adds UI as well. Could be checked for regular file save even...
Quit.blend and temp file saving use this now.
- Dixed filename in window on reading quit.blend or temp saves, and they now add a warning in window title: "(Recovered)"
- New Userpref option "Keep Session" - this always saves quit.blend, and loads on start.
This allows keeping UI and data without actual saves, until you actually save.
When you load startup.blend and quit, it recognises the quit.blend as a startup (no file name in header)
- Added 3D view copy/paste buffers (selected objects). Shortcuts ctrl-c, ctrl-v (OSX, cmd-c, cmd-v).
Coded partial file saving for it. Could be used for other purposes. Todo: use OS clipboards.
- User preferences (themes, keymaps, user settings) now can be saved as a separate file.
Old option is called "Save Startup File" the new one "Save User Settings".
To visualise this difference, the 'save startup file' button has been removed from user preferences window. That option is available as CTRL+U and in File menu still.
- OSX: fixed bug that stopped giving mouse events outside window.
This also fixes "Continuous Grab" for OSX. (error since 2009)
2012-12-12 18:58:11 +00:00
|
|
|
float pad = 0.2f * U.widget_unit;
|
2011-11-19 22:05:18 +00:00
|
|
|
|
2012-05-08 15:43:59 +00:00
|
|
|
glRectf((x1 + x2 - width) * 0.5f, y1 + pad, (x1 + x2 + width) * 0.5f, y2 - pad);
|
|
|
|
glRectf(x1 + pad, (y1 + y2 - width) * 0.5f, (x1 + x2 - width) * 0.5f, (y1 + y2 + width) * 0.5f);
|
|
|
|
glRectf((x1 + x2 + width) * 0.5f, (y1 + y2 - width) * 0.5f, x2 - pad, (y1 + y2 + width) * 0.5f);
|
2011-11-19 22:05:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void region_draw_azone_tab_plus(AZone *az)
|
|
|
|
{
|
|
|
|
glEnable(GL_BLEND);
|
|
|
|
|
|
|
|
/* add code to draw region hidden as 'too small' */
|
2012-04-28 06:31:57 +00:00
|
|
|
switch (az->edge) {
|
2011-11-19 22:05:18 +00:00
|
|
|
case AE_TOP_TO_BOTTOMRIGHT:
|
2014-11-09 21:20:40 +01:00
|
|
|
UI_draw_roundbox_corner_set(UI_CNR_TOP_LEFT | UI_CNR_TOP_RIGHT);
|
2011-11-19 22:05:18 +00:00
|
|
|
break;
|
|
|
|
case AE_BOTTOM_TO_TOPLEFT:
|
2014-11-09 21:20:40 +01:00
|
|
|
UI_draw_roundbox_corner_set(UI_CNR_BOTTOM_RIGHT | UI_CNR_BOTTOM_LEFT);
|
2011-11-19 22:05:18 +00:00
|
|
|
break;
|
|
|
|
case AE_LEFT_TO_TOPRIGHT:
|
2014-11-09 21:20:40 +01:00
|
|
|
UI_draw_roundbox_corner_set(UI_CNR_TOP_LEFT | UI_CNR_BOTTOM_LEFT);
|
2011-11-19 22:05:18 +00:00
|
|
|
break;
|
|
|
|
case AE_RIGHT_TO_TOPLEFT:
|
2014-11-09 21:20:40 +01:00
|
|
|
UI_draw_roundbox_corner_set(UI_CNR_TOP_RIGHT | UI_CNR_BOTTOM_RIGHT);
|
2011-11-19 22:05:18 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2011-11-27 14:06:47 +00:00
|
|
|
glColor4f(0.05f, 0.05f, 0.05f, 0.4f);
|
2014-11-09 21:20:40 +01:00
|
|
|
UI_draw_roundbox((float)az->x1, (float)az->y1, (float)az->x2, (float)az->y2, 4.0f);
|
2011-11-19 22:05:18 +00:00
|
|
|
|
|
|
|
glEnable(GL_BLEND);
|
|
|
|
|
2011-11-27 14:06:47 +00:00
|
|
|
glColor4f(0.8f, 0.8f, 0.8f, 0.4f);
|
2011-11-19 22:05:18 +00:00
|
|
|
draw_azone_plus((float)az->x1, (float)az->y1, (float)az->x2, (float)az->y2);
|
|
|
|
|
|
|
|
glDisable(GL_BLEND);
|
|
|
|
}
|
|
|
|
|
Todo item:
Closed regions didn't always draw the (+) icon right place, confusing
for users.
Next to that, I think this icon is using a bad metaphor or visual language,
Illustrated best if you close a header in outliner or buttons. Icons are
UI widgets, for screen/editor layouts different controls can be stylized.
My preference is something that aligns visually to the seperators between
regions; for testing and hacking pleasure I've added two quick versions,
a small tabbish thing and a triangle. Enable these with debug menu,
ALT+CTRL+D, values 1 or 2.
This is simply drawn with opengl now. An image for it can be made as well.
Previews:
http://www.blender.org/bf/closed_regions1.png
http://www.blender.org/bf/closed_regions2.png
http://www.blender.org/bf/closed_regions3.png
There's other design ideas to explore as well, like making region deviders
8-10 pixels wide, with a 'drag me' dot on it or so. That takes some screen
estate though, and will require to add big editor-dividers too...
Fun stuff for the mockup-mafia to check on, we have time :)
2011-06-30 15:02:03 +00:00
|
|
|
static void region_draw_azone_tab(AZone *az)
|
|
|
|
{
|
|
|
|
float col[3];
|
|
|
|
|
|
|
|
glEnable(GL_BLEND);
|
|
|
|
UI_GetThemeColor3fv(TH_HEADER, col);
|
|
|
|
glColor4f(col[0], col[1], col[2], 0.5f);
|
|
|
|
|
|
|
|
/* add code to draw region hidden as 'too small' */
|
2012-04-28 06:31:57 +00:00
|
|
|
switch (az->edge) {
|
Todo item:
Closed regions didn't always draw the (+) icon right place, confusing
for users.
Next to that, I think this icon is using a bad metaphor or visual language,
Illustrated best if you close a header in outliner or buttons. Icons are
UI widgets, for screen/editor layouts different controls can be stylized.
My preference is something that aligns visually to the seperators between
regions; for testing and hacking pleasure I've added two quick versions,
a small tabbish thing and a triangle. Enable these with debug menu,
ALT+CTRL+D, values 1 or 2.
This is simply drawn with opengl now. An image for it can be made as well.
Previews:
http://www.blender.org/bf/closed_regions1.png
http://www.blender.org/bf/closed_regions2.png
http://www.blender.org/bf/closed_regions3.png
There's other design ideas to explore as well, like making region deviders
8-10 pixels wide, with a 'drag me' dot on it or so. That takes some screen
estate though, and will require to add big editor-dividers too...
Fun stuff for the mockup-mafia to check on, we have time :)
2011-06-30 15:02:03 +00:00
|
|
|
case AE_TOP_TO_BOTTOMRIGHT:
|
2014-11-09 21:20:40 +01:00
|
|
|
UI_draw_roundbox_corner_set(UI_CNR_TOP_LEFT | UI_CNR_TOP_RIGHT | UI_RB_ALPHA);
|
Todo item:
Closed regions didn't always draw the (+) icon right place, confusing
for users.
Next to that, I think this icon is using a bad metaphor or visual language,
Illustrated best if you close a header in outliner or buttons. Icons are
UI widgets, for screen/editor layouts different controls can be stylized.
My preference is something that aligns visually to the seperators between
regions; for testing and hacking pleasure I've added two quick versions,
a small tabbish thing and a triangle. Enable these with debug menu,
ALT+CTRL+D, values 1 or 2.
This is simply drawn with opengl now. An image for it can be made as well.
Previews:
http://www.blender.org/bf/closed_regions1.png
http://www.blender.org/bf/closed_regions2.png
http://www.blender.org/bf/closed_regions3.png
There's other design ideas to explore as well, like making region deviders
8-10 pixels wide, with a 'drag me' dot on it or so. That takes some screen
estate though, and will require to add big editor-dividers too...
Fun stuff for the mockup-mafia to check on, we have time :)
2011-06-30 15:02:03 +00:00
|
|
|
|
2014-11-09 21:20:40 +01:00
|
|
|
UI_draw_roundbox_shade_x(GL_POLYGON, (float)az->x1, (float)az->y1, (float)az->x2, (float)az->y2, 4.0f, -0.3f, 0.05f);
|
Todo item:
Closed regions didn't always draw the (+) icon right place, confusing
for users.
Next to that, I think this icon is using a bad metaphor or visual language,
Illustrated best if you close a header in outliner or buttons. Icons are
UI widgets, for screen/editor layouts different controls can be stylized.
My preference is something that aligns visually to the seperators between
regions; for testing and hacking pleasure I've added two quick versions,
a small tabbish thing and a triangle. Enable these with debug menu,
ALT+CTRL+D, values 1 or 2.
This is simply drawn with opengl now. An image for it can be made as well.
Previews:
http://www.blender.org/bf/closed_regions1.png
http://www.blender.org/bf/closed_regions2.png
http://www.blender.org/bf/closed_regions3.png
There's other design ideas to explore as well, like making region deviders
8-10 pixels wide, with a 'drag me' dot on it or so. That takes some screen
estate though, and will require to add big editor-dividers too...
Fun stuff for the mockup-mafia to check on, we have time :)
2011-06-30 15:02:03 +00:00
|
|
|
glColor4ub(0, 0, 0, 255);
|
2014-11-09 21:20:40 +01:00
|
|
|
UI_draw_roundbox_unfilled((float)az->x1, 0.3f + (float)az->y1, (float)az->x2, 0.3f + (float)az->y2, 4.0f);
|
Todo item:
Closed regions didn't always draw the (+) icon right place, confusing
for users.
Next to that, I think this icon is using a bad metaphor or visual language,
Illustrated best if you close a header in outliner or buttons. Icons are
UI widgets, for screen/editor layouts different controls can be stylized.
My preference is something that aligns visually to the seperators between
regions; for testing and hacking pleasure I've added two quick versions,
a small tabbish thing and a triangle. Enable these with debug menu,
ALT+CTRL+D, values 1 or 2.
This is simply drawn with opengl now. An image for it can be made as well.
Previews:
http://www.blender.org/bf/closed_regions1.png
http://www.blender.org/bf/closed_regions2.png
http://www.blender.org/bf/closed_regions3.png
There's other design ideas to explore as well, like making region deviders
8-10 pixels wide, with a 'drag me' dot on it or so. That takes some screen
estate though, and will require to add big editor-dividers too...
Fun stuff for the mockup-mafia to check on, we have time :)
2011-06-30 15:02:03 +00:00
|
|
|
break;
|
|
|
|
case AE_BOTTOM_TO_TOPLEFT:
|
2014-11-09 21:20:40 +01:00
|
|
|
UI_draw_roundbox_corner_set(UI_CNR_BOTTOM_RIGHT | UI_CNR_BOTTOM_LEFT | UI_RB_ALPHA);
|
Todo item:
Closed regions didn't always draw the (+) icon right place, confusing
for users.
Next to that, I think this icon is using a bad metaphor or visual language,
Illustrated best if you close a header in outliner or buttons. Icons are
UI widgets, for screen/editor layouts different controls can be stylized.
My preference is something that aligns visually to the seperators between
regions; for testing and hacking pleasure I've added two quick versions,
a small tabbish thing and a triangle. Enable these with debug menu,
ALT+CTRL+D, values 1 or 2.
This is simply drawn with opengl now. An image for it can be made as well.
Previews:
http://www.blender.org/bf/closed_regions1.png
http://www.blender.org/bf/closed_regions2.png
http://www.blender.org/bf/closed_regions3.png
There's other design ideas to explore as well, like making region deviders
8-10 pixels wide, with a 'drag me' dot on it or so. That takes some screen
estate though, and will require to add big editor-dividers too...
Fun stuff for the mockup-mafia to check on, we have time :)
2011-06-30 15:02:03 +00:00
|
|
|
|
2014-11-09 21:20:40 +01:00
|
|
|
UI_draw_roundbox_shade_x(GL_POLYGON, (float)az->x1, (float)az->y1, (float)az->x2, (float)az->y2, 4.0f, -0.3f, 0.05f);
|
Todo item:
Closed regions didn't always draw the (+) icon right place, confusing
for users.
Next to that, I think this icon is using a bad metaphor or visual language,
Illustrated best if you close a header in outliner or buttons. Icons are
UI widgets, for screen/editor layouts different controls can be stylized.
My preference is something that aligns visually to the seperators between
regions; for testing and hacking pleasure I've added two quick versions,
a small tabbish thing and a triangle. Enable these with debug menu,
ALT+CTRL+D, values 1 or 2.
This is simply drawn with opengl now. An image for it can be made as well.
Previews:
http://www.blender.org/bf/closed_regions1.png
http://www.blender.org/bf/closed_regions2.png
http://www.blender.org/bf/closed_regions3.png
There's other design ideas to explore as well, like making region deviders
8-10 pixels wide, with a 'drag me' dot on it or so. That takes some screen
estate though, and will require to add big editor-dividers too...
Fun stuff for the mockup-mafia to check on, we have time :)
2011-06-30 15:02:03 +00:00
|
|
|
glColor4ub(0, 0, 0, 255);
|
2014-11-09 21:20:40 +01:00
|
|
|
UI_draw_roundbox_unfilled((float)az->x1, 0.3f + (float)az->y1, (float)az->x2, 0.3f + (float)az->y2, 4.0f);
|
Todo item:
Closed regions didn't always draw the (+) icon right place, confusing
for users.
Next to that, I think this icon is using a bad metaphor or visual language,
Illustrated best if you close a header in outliner or buttons. Icons are
UI widgets, for screen/editor layouts different controls can be stylized.
My preference is something that aligns visually to the seperators between
regions; for testing and hacking pleasure I've added two quick versions,
a small tabbish thing and a triangle. Enable these with debug menu,
ALT+CTRL+D, values 1 or 2.
This is simply drawn with opengl now. An image for it can be made as well.
Previews:
http://www.blender.org/bf/closed_regions1.png
http://www.blender.org/bf/closed_regions2.png
http://www.blender.org/bf/closed_regions3.png
There's other design ideas to explore as well, like making region deviders
8-10 pixels wide, with a 'drag me' dot on it or so. That takes some screen
estate though, and will require to add big editor-dividers too...
Fun stuff for the mockup-mafia to check on, we have time :)
2011-06-30 15:02:03 +00:00
|
|
|
break;
|
|
|
|
case AE_LEFT_TO_TOPRIGHT:
|
2014-11-09 21:20:40 +01:00
|
|
|
UI_draw_roundbox_corner_set(UI_CNR_TOP_LEFT | UI_CNR_BOTTOM_LEFT | UI_RB_ALPHA);
|
Todo item:
Closed regions didn't always draw the (+) icon right place, confusing
for users.
Next to that, I think this icon is using a bad metaphor or visual language,
Illustrated best if you close a header in outliner or buttons. Icons are
UI widgets, for screen/editor layouts different controls can be stylized.
My preference is something that aligns visually to the seperators between
regions; for testing and hacking pleasure I've added two quick versions,
a small tabbish thing and a triangle. Enable these with debug menu,
ALT+CTRL+D, values 1 or 2.
This is simply drawn with opengl now. An image for it can be made as well.
Previews:
http://www.blender.org/bf/closed_regions1.png
http://www.blender.org/bf/closed_regions2.png
http://www.blender.org/bf/closed_regions3.png
There's other design ideas to explore as well, like making region deviders
8-10 pixels wide, with a 'drag me' dot on it or so. That takes some screen
estate though, and will require to add big editor-dividers too...
Fun stuff for the mockup-mafia to check on, we have time :)
2011-06-30 15:02:03 +00:00
|
|
|
|
2014-11-09 21:20:40 +01:00
|
|
|
UI_draw_roundbox_shade_x(GL_POLYGON, (float)az->x1, (float)az->y1, (float)az->x2, (float)az->y2, 4.0f, -0.3f, 0.05f);
|
Todo item:
Closed regions didn't always draw the (+) icon right place, confusing
for users.
Next to that, I think this icon is using a bad metaphor or visual language,
Illustrated best if you close a header in outliner or buttons. Icons are
UI widgets, for screen/editor layouts different controls can be stylized.
My preference is something that aligns visually to the seperators between
regions; for testing and hacking pleasure I've added two quick versions,
a small tabbish thing and a triangle. Enable these with debug menu,
ALT+CTRL+D, values 1 or 2.
This is simply drawn with opengl now. An image for it can be made as well.
Previews:
http://www.blender.org/bf/closed_regions1.png
http://www.blender.org/bf/closed_regions2.png
http://www.blender.org/bf/closed_regions3.png
There's other design ideas to explore as well, like making region deviders
8-10 pixels wide, with a 'drag me' dot on it or so. That takes some screen
estate though, and will require to add big editor-dividers too...
Fun stuff for the mockup-mafia to check on, we have time :)
2011-06-30 15:02:03 +00:00
|
|
|
glColor4ub(0, 0, 0, 255);
|
2014-11-09 21:20:40 +01:00
|
|
|
UI_draw_roundbox_unfilled((float)az->x1, (float)az->y1, (float)az->x2, (float)az->y2, 4.0f);
|
Todo item:
Closed regions didn't always draw the (+) icon right place, confusing
for users.
Next to that, I think this icon is using a bad metaphor or visual language,
Illustrated best if you close a header in outliner or buttons. Icons are
UI widgets, for screen/editor layouts different controls can be stylized.
My preference is something that aligns visually to the seperators between
regions; for testing and hacking pleasure I've added two quick versions,
a small tabbish thing and a triangle. Enable these with debug menu,
ALT+CTRL+D, values 1 or 2.
This is simply drawn with opengl now. An image for it can be made as well.
Previews:
http://www.blender.org/bf/closed_regions1.png
http://www.blender.org/bf/closed_regions2.png
http://www.blender.org/bf/closed_regions3.png
There's other design ideas to explore as well, like making region deviders
8-10 pixels wide, with a 'drag me' dot on it or so. That takes some screen
estate though, and will require to add big editor-dividers too...
Fun stuff for the mockup-mafia to check on, we have time :)
2011-06-30 15:02:03 +00:00
|
|
|
break;
|
|
|
|
case AE_RIGHT_TO_TOPLEFT:
|
2014-11-09 21:20:40 +01:00
|
|
|
UI_draw_roundbox_corner_set(UI_CNR_TOP_RIGHT | UI_CNR_BOTTOM_RIGHT | UI_RB_ALPHA);
|
Todo item:
Closed regions didn't always draw the (+) icon right place, confusing
for users.
Next to that, I think this icon is using a bad metaphor or visual language,
Illustrated best if you close a header in outliner or buttons. Icons are
UI widgets, for screen/editor layouts different controls can be stylized.
My preference is something that aligns visually to the seperators between
regions; for testing and hacking pleasure I've added two quick versions,
a small tabbish thing and a triangle. Enable these with debug menu,
ALT+CTRL+D, values 1 or 2.
This is simply drawn with opengl now. An image for it can be made as well.
Previews:
http://www.blender.org/bf/closed_regions1.png
http://www.blender.org/bf/closed_regions2.png
http://www.blender.org/bf/closed_regions3.png
There's other design ideas to explore as well, like making region deviders
8-10 pixels wide, with a 'drag me' dot on it or so. That takes some screen
estate though, and will require to add big editor-dividers too...
Fun stuff for the mockup-mafia to check on, we have time :)
2011-06-30 15:02:03 +00:00
|
|
|
|
2014-11-09 21:20:40 +01:00
|
|
|
UI_draw_roundbox_shade_x(GL_POLYGON, (float)az->x1, (float)az->y1, (float)az->x2, (float)az->y2, 4.0f, -0.3f, 0.05f);
|
Todo item:
Closed regions didn't always draw the (+) icon right place, confusing
for users.
Next to that, I think this icon is using a bad metaphor or visual language,
Illustrated best if you close a header in outliner or buttons. Icons are
UI widgets, for screen/editor layouts different controls can be stylized.
My preference is something that aligns visually to the seperators between
regions; for testing and hacking pleasure I've added two quick versions,
a small tabbish thing and a triangle. Enable these with debug menu,
ALT+CTRL+D, values 1 or 2.
This is simply drawn with opengl now. An image for it can be made as well.
Previews:
http://www.blender.org/bf/closed_regions1.png
http://www.blender.org/bf/closed_regions2.png
http://www.blender.org/bf/closed_regions3.png
There's other design ideas to explore as well, like making region deviders
8-10 pixels wide, with a 'drag me' dot on it or so. That takes some screen
estate though, and will require to add big editor-dividers too...
Fun stuff for the mockup-mafia to check on, we have time :)
2011-06-30 15:02:03 +00:00
|
|
|
glColor4ub(0, 0, 0, 255);
|
2014-11-09 21:20:40 +01:00
|
|
|
UI_draw_roundbox_unfilled((float)az->x1, (float)az->y1, (float)az->x2, (float)az->y2, 4.0f);
|
Todo item:
Closed regions didn't always draw the (+) icon right place, confusing
for users.
Next to that, I think this icon is using a bad metaphor or visual language,
Illustrated best if you close a header in outliner or buttons. Icons are
UI widgets, for screen/editor layouts different controls can be stylized.
My preference is something that aligns visually to the seperators between
regions; for testing and hacking pleasure I've added two quick versions,
a small tabbish thing and a triangle. Enable these with debug menu,
ALT+CTRL+D, values 1 or 2.
This is simply drawn with opengl now. An image for it can be made as well.
Previews:
http://www.blender.org/bf/closed_regions1.png
http://www.blender.org/bf/closed_regions2.png
http://www.blender.org/bf/closed_regions3.png
There's other design ideas to explore as well, like making region deviders
8-10 pixels wide, with a 'drag me' dot on it or so. That takes some screen
estate though, and will require to add big editor-dividers too...
Fun stuff for the mockup-mafia to check on, we have time :)
2011-06-30 15:02:03 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
glDisable(GL_BLEND);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void region_draw_azone_tria(AZone *az)
|
|
|
|
{
|
|
|
|
glEnable(GL_BLEND);
|
|
|
|
//UI_GetThemeColor3fv(TH_HEADER, col);
|
|
|
|
glColor4f(0.0f, 0.0f, 0.0f, 0.35f);
|
|
|
|
|
|
|
|
/* add code to draw region hidden as 'too small' */
|
2012-04-28 06:31:57 +00:00
|
|
|
switch (az->edge) {
|
Todo item:
Closed regions didn't always draw the (+) icon right place, confusing
for users.
Next to that, I think this icon is using a bad metaphor or visual language,
Illustrated best if you close a header in outliner or buttons. Icons are
UI widgets, for screen/editor layouts different controls can be stylized.
My preference is something that aligns visually to the seperators between
regions; for testing and hacking pleasure I've added two quick versions,
a small tabbish thing and a triangle. Enable these with debug menu,
ALT+CTRL+D, values 1 or 2.
This is simply drawn with opengl now. An image for it can be made as well.
Previews:
http://www.blender.org/bf/closed_regions1.png
http://www.blender.org/bf/closed_regions2.png
http://www.blender.org/bf/closed_regions3.png
There's other design ideas to explore as well, like making region deviders
8-10 pixels wide, with a 'drag me' dot on it or so. That takes some screen
estate though, and will require to add big editor-dividers too...
Fun stuff for the mockup-mafia to check on, we have time :)
2011-06-30 15:02:03 +00:00
|
|
|
case AE_TOP_TO_BOTTOMRIGHT:
|
2012-05-08 15:43:59 +00:00
|
|
|
ui_draw_anti_tria((float)az->x1, (float)az->y1, (float)az->x2, (float)az->y1, (float)(az->x1 + az->x2) / 2, (float)az->y2);
|
Todo item:
Closed regions didn't always draw the (+) icon right place, confusing
for users.
Next to that, I think this icon is using a bad metaphor or visual language,
Illustrated best if you close a header in outliner or buttons. Icons are
UI widgets, for screen/editor layouts different controls can be stylized.
My preference is something that aligns visually to the seperators between
regions; for testing and hacking pleasure I've added two quick versions,
a small tabbish thing and a triangle. Enable these with debug menu,
ALT+CTRL+D, values 1 or 2.
This is simply drawn with opengl now. An image for it can be made as well.
Previews:
http://www.blender.org/bf/closed_regions1.png
http://www.blender.org/bf/closed_regions2.png
http://www.blender.org/bf/closed_regions3.png
There's other design ideas to explore as well, like making region deviders
8-10 pixels wide, with a 'drag me' dot on it or so. That takes some screen
estate though, and will require to add big editor-dividers too...
Fun stuff for the mockup-mafia to check on, we have time :)
2011-06-30 15:02:03 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case AE_BOTTOM_TO_TOPLEFT:
|
2012-05-08 15:43:59 +00:00
|
|
|
ui_draw_anti_tria((float)az->x1, (float)az->y2, (float)az->x2, (float)az->y2, (float)(az->x1 + az->x2) / 2, (float)az->y1);
|
Todo item:
Closed regions didn't always draw the (+) icon right place, confusing
for users.
Next to that, I think this icon is using a bad metaphor or visual language,
Illustrated best if you close a header in outliner or buttons. Icons are
UI widgets, for screen/editor layouts different controls can be stylized.
My preference is something that aligns visually to the seperators between
regions; for testing and hacking pleasure I've added two quick versions,
a small tabbish thing and a triangle. Enable these with debug menu,
ALT+CTRL+D, values 1 or 2.
This is simply drawn with opengl now. An image for it can be made as well.
Previews:
http://www.blender.org/bf/closed_regions1.png
http://www.blender.org/bf/closed_regions2.png
http://www.blender.org/bf/closed_regions3.png
There's other design ideas to explore as well, like making region deviders
8-10 pixels wide, with a 'drag me' dot on it or so. That takes some screen
estate though, and will require to add big editor-dividers too...
Fun stuff for the mockup-mafia to check on, we have time :)
2011-06-30 15:02:03 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case AE_LEFT_TO_TOPRIGHT:
|
2012-05-08 15:43:59 +00:00
|
|
|
ui_draw_anti_tria((float)az->x2, (float)az->y1, (float)az->x2, (float)az->y2, (float)az->x1, (float)(az->y1 + az->y2) / 2);
|
Todo item:
Closed regions didn't always draw the (+) icon right place, confusing
for users.
Next to that, I think this icon is using a bad metaphor or visual language,
Illustrated best if you close a header in outliner or buttons. Icons are
UI widgets, for screen/editor layouts different controls can be stylized.
My preference is something that aligns visually to the seperators between
regions; for testing and hacking pleasure I've added two quick versions,
a small tabbish thing and a triangle. Enable these with debug menu,
ALT+CTRL+D, values 1 or 2.
This is simply drawn with opengl now. An image for it can be made as well.
Previews:
http://www.blender.org/bf/closed_regions1.png
http://www.blender.org/bf/closed_regions2.png
http://www.blender.org/bf/closed_regions3.png
There's other design ideas to explore as well, like making region deviders
8-10 pixels wide, with a 'drag me' dot on it or so. That takes some screen
estate though, and will require to add big editor-dividers too...
Fun stuff for the mockup-mafia to check on, we have time :)
2011-06-30 15:02:03 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case AE_RIGHT_TO_TOPLEFT:
|
2012-05-08 15:43:59 +00:00
|
|
|
ui_draw_anti_tria((float)az->x1, (float)az->y1, (float)az->x1, (float)az->y2, (float)az->x2, (float)(az->y1 + az->y2) / 2);
|
Todo item:
Closed regions didn't always draw the (+) icon right place, confusing
for users.
Next to that, I think this icon is using a bad metaphor or visual language,
Illustrated best if you close a header in outliner or buttons. Icons are
UI widgets, for screen/editor layouts different controls can be stylized.
My preference is something that aligns visually to the seperators between
regions; for testing and hacking pleasure I've added two quick versions,
a small tabbish thing and a triangle. Enable these with debug menu,
ALT+CTRL+D, values 1 or 2.
This is simply drawn with opengl now. An image for it can be made as well.
Previews:
http://www.blender.org/bf/closed_regions1.png
http://www.blender.org/bf/closed_regions2.png
http://www.blender.org/bf/closed_regions3.png
There's other design ideas to explore as well, like making region deviders
8-10 pixels wide, with a 'drag me' dot on it or so. That takes some screen
estate though, and will require to add big editor-dividers too...
Fun stuff for the mockup-mafia to check on, we have time :)
2011-06-30 15:02:03 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
glDisable(GL_BLEND);
|
|
|
|
}
|
2.5
First version of region-scaling. WIP commit, so bear with me a while!
- All fixed sized regions have a small 'drag' widget, on the left or top.
(not yet for free-sized regions, like 4-split).
- Mouse-over on widget changes cursor and allows drag.
- Click on widget hides/reveals.
- Fun for test; 3d view header, if high enough, draws more rows of
buttons when width is too small.
The WIP stuff;
- It doesn't save yet in files, using the "minsize" variable of region
definitions, also means other similar areas show same sizes now.
- Definitions for pref size, min/max will be added.
- Properties panel in Fcurve window draws widget on wrong place when
hidden (subdiv system needs tweak)
- Widgets don't draw perfect yet, also needs further tweaks.
But, in general it's quite fun and usable. :) Many variatians are possible,
like for real tabs, or little icons, or just click-drag on edge.
The reason to first try the widget/tab variation:
- it re-uses the "Area Action Zone" code, widgets for layouting Screens
- it's visible, hotkey-only options for screen layouts are not preferred.
- distinguish clearly area-edges from region-edges this way. Having the
cursor change shape on every edge (and block input) is probably annoying
too... but that can be tested.
Later more!
2009-05-24 13:29:29 +00:00
|
|
|
|
2015-04-25 01:29:53 +02:00
|
|
|
static void area_azone_tag_update(ScrArea *sa)
|
|
|
|
{
|
|
|
|
sa->flag |= AREA_FLAG_ACTIONZONES_UPDATE;
|
|
|
|
}
|
|
|
|
|
2013-05-15 17:59:55 +00:00
|
|
|
static void region_draw_azones(ScrArea *sa, ARegion *ar)
|
2008-12-16 18:42:12 +00:00
|
|
|
{
|
2013-05-15 17:59:55 +00:00
|
|
|
AZone *az;
|
|
|
|
|
|
|
|
if (!sa)
|
|
|
|
return;
|
2008-12-16 18:42:12 +00:00
|
|
|
|
2012-04-29 17:11:40 +00:00
|
|
|
glEnable(GL_BLEND);
|
|
|
|
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
2013-05-15 17:59:55 +00:00
|
|
|
|
|
|
|
glPushMatrix();
|
|
|
|
glTranslatef(-ar->winrct.xmin, -ar->winrct.ymin, 0.0f);
|
2008-11-24 10:45:36 +00:00
|
|
|
|
2013-05-15 17:59:55 +00:00
|
|
|
for (az = sa->actionzones.first; az; az = az->next) {
|
|
|
|
/* test if action zone is over this region */
|
|
|
|
rcti azrct;
|
|
|
|
BLI_rcti_init(&azrct, az->x1, az->x2, az->y1, az->y2);
|
|
|
|
|
|
|
|
if (BLI_rcti_isect(&ar->drawrct, &azrct, NULL)) {
|
|
|
|
if (az->type == AZONE_AREA) {
|
|
|
|
area_draw_azone(az->x1, az->y1, az->x2, az->y2);
|
|
|
|
}
|
|
|
|
else if (az->type == AZONE_REGION) {
|
|
|
|
|
|
|
|
if (az->ar) {
|
|
|
|
/* only display tab or icons when the region is hidden */
|
|
|
|
if (az->ar->flag & (RGN_FLAG_HIDDEN | RGN_FLAG_TOO_SMALL)) {
|
|
|
|
if (G.debug_value == 3)
|
|
|
|
region_draw_azone_icon(az);
|
|
|
|
else if (G.debug_value == 2)
|
|
|
|
region_draw_azone_tria(az);
|
|
|
|
else if (G.debug_value == 1)
|
|
|
|
region_draw_azone_tab(az);
|
|
|
|
else
|
|
|
|
region_draw_azone_tab_plus(az);
|
Todo item:
Closed regions didn't always draw the (+) icon right place, confusing
for users.
Next to that, I think this icon is using a bad metaphor or visual language,
Illustrated best if you close a header in outliner or buttons. Icons are
UI widgets, for screen/editor layouts different controls can be stylized.
My preference is something that aligns visually to the seperators between
regions; for testing and hacking pleasure I've added two quick versions,
a small tabbish thing and a triangle. Enable these with debug menu,
ALT+CTRL+D, values 1 or 2.
This is simply drawn with opengl now. An image for it can be made as well.
Previews:
http://www.blender.org/bf/closed_regions1.png
http://www.blender.org/bf/closed_regions2.png
http://www.blender.org/bf/closed_regions3.png
There's other design ideas to explore as well, like making region deviders
8-10 pixels wide, with a 'drag me' dot on it or so. That takes some screen
estate though, and will require to add big editor-dividers too...
Fun stuff for the mockup-mafia to check on, we have time :)
2011-06-30 15:02:03 +00:00
|
|
|
}
|
2009-09-12 23:56:30 +00:00
|
|
|
}
|
2008-12-16 18:42:12 +00:00
|
|
|
}
|
2014-10-14 15:05:44 -03:00
|
|
|
else if (az->type == AZONE_FULLSCREEN) {
|
|
|
|
area_draw_azone_fullscreen(az->x1, az->y1, az->x2, az->y2, az->alpha);
|
2015-04-25 01:29:53 +02:00
|
|
|
|
|
|
|
if (az->alpha != 0.0f) {
|
|
|
|
area_azone_tag_update(sa);
|
|
|
|
}
|
2014-10-14 15:05:44 -03:00
|
|
|
}
|
2008-12-16 18:42:12 +00:00
|
|
|
}
|
2012-10-21 05:46:41 +00:00
|
|
|
}
|
2013-05-15 17:59:55 +00:00
|
|
|
|
|
|
|
glPopMatrix();
|
|
|
|
|
2012-04-29 17:11:40 +00:00
|
|
|
glDisable(GL_BLEND);
|
2008-11-24 10:45:36 +00:00
|
|
|
}
|
|
|
|
|
2009-07-19 12:15:20 +00:00
|
|
|
/* only exported for WM */
|
|
|
|
/* makes region ready for drawing, sets pixelspace */
|
|
|
|
void ED_region_set(const bContext *C, ARegion *ar)
|
|
|
|
{
|
2012-05-08 15:43:59 +00:00
|
|
|
wmWindow *win = CTX_wm_window(C);
|
|
|
|
ScrArea *sa = CTX_wm_area(C);
|
2009-07-19 12:15:20 +00:00
|
|
|
|
Holiday coding log :)
Nice formatted version (pictures soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.66/Usability
Short list of main changes:
- Transparent region option (over main region), added code to blend in/out such panels.
- Min size window now 640 x 480
- Fixed DPI for ui - lots of cleanup and changes everywhere. Icon image need correct size still, layer-in-use icon needs remake.
- Macbook retina support, use command line --no-native-pixels to disable it
- Timeline Marker label was drawing wrong
- Trackpad and magic mouse: supports zoom (hold ctrl)
- Fix for splash position: removed ghost function and made window size update after creation immediate
- Fast undo buffer save now adds UI as well. Could be checked for regular file save even...
Quit.blend and temp file saving use this now.
- Dixed filename in window on reading quit.blend or temp saves, and they now add a warning in window title: "(Recovered)"
- New Userpref option "Keep Session" - this always saves quit.blend, and loads on start.
This allows keeping UI and data without actual saves, until you actually save.
When you load startup.blend and quit, it recognises the quit.blend as a startup (no file name in header)
- Added 3D view copy/paste buffers (selected objects). Shortcuts ctrl-c, ctrl-v (OSX, cmd-c, cmd-v).
Coded partial file saving for it. Could be used for other purposes. Todo: use OS clipboards.
- User preferences (themes, keymaps, user settings) now can be saved as a separate file.
Old option is called "Save Startup File" the new one "Save User Settings".
To visualise this difference, the 'save startup file' button has been removed from user preferences window. That option is available as CTRL+U and in File menu still.
- OSX: fixed bug that stopped giving mouse events outside window.
This also fixes "Continuous Grab" for OSX. (error since 2009)
2012-12-12 18:58:11 +00:00
|
|
|
ar->drawrct = ar->winrct;
|
2009-07-19 12:15:20 +00:00
|
|
|
|
|
|
|
/* note; this sets state, so we can use wmOrtho and friends */
|
2013-08-05 04:52:27 +00:00
|
|
|
wmSubWindowScissorSet(win, ar->swinid, &ar->drawrct, true);
|
2009-07-19 12:15:20 +00:00
|
|
|
|
2012-05-08 15:43:59 +00:00
|
|
|
UI_SetTheme(sa ? sa->spacetype : 0, ar->type ? ar->type->regionid : 0);
|
2009-07-19 12:15:20 +00:00
|
|
|
|
|
|
|
ED_region_pixelspace(ar);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-01-04 17:45:54 +00:00
|
|
|
/* only exported for WM */
|
2008-01-07 18:03:41 +00:00
|
|
|
void ED_region_do_draw(bContext *C, ARegion *ar)
|
|
|
|
{
|
2012-05-08 15:43:59 +00:00
|
|
|
wmWindow *win = CTX_wm_window(C);
|
|
|
|
ScrArea *sa = CTX_wm_area(C);
|
|
|
|
ARegionType *at = ar->type;
|
2013-08-05 04:52:27 +00:00
|
|
|
bool scissor_pad;
|
|
|
|
|
2011-03-25 17:11:32 +00:00
|
|
|
/* see BKE_spacedata_draw_locks() */
|
2012-03-24 06:38:07 +00:00
|
|
|
if (at->do_lock)
|
2011-03-25 17:11:32 +00:00
|
|
|
return;
|
2014-04-02 18:42:08 +11:00
|
|
|
|
2.5: WM Compositing
* Triple Buffer is now more complete:
- Proper handling of window resize, duplicate, etc.
- It now uses 3x3 textures (or less) if the power of two sizes
do not match well. That still has a worst case wast of 23.4%,
but better than 300%.
- It can also use the ARB/NV/EXT_texture_rectangle extension
now, which may be supported on hardware that does not support
ARB_texture_non_power_of_two.
- Gesture, menu and brushe redraws now require no redraws at all
from the area regions. So even on a high poly scene just moving
the paint cursor or opening a menu should be fast.
* Testing can be done by setting the "Window Draw Method" in the
User Preferences in the outliner. "Overlap" is still default,
since "Triple Buffer" has not been tested on computers other than
mine, would like to avoid crashing Blender on startup in case
there is a common bug, but it's ready for testing now.
- For reference "Full" draws the full window each time.
- "Triple Buffer" should work for both swap copy and swap exchange
systems, the latter still need the -E command line option for
"Overlap".
- Resizing and going fullscreen still gives flicker here but no
more than "Full" drawing.
* Partial Redraw was added. ED_region_tag_redraw_partial takes a
rect in window coordinates to define a subarea of the region.
On region draw it will then set glScissor to a smaller area, and
ar->drawrct will always be set to either the partial or full
window rect. The latter can then be used for clipping in the 3D
view or clipping interface drawing. Neither is implemented yet.
2009-01-23 03:52:52 +00:00
|
|
|
/* if no partial draw rect set, full rect */
|
2013-08-05 04:52:27 +00:00
|
|
|
if (ar->drawrct.xmin == ar->drawrct.xmax) {
|
Holiday coding log :)
Nice formatted version (pictures soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.66/Usability
Short list of main changes:
- Transparent region option (over main region), added code to blend in/out such panels.
- Min size window now 640 x 480
- Fixed DPI for ui - lots of cleanup and changes everywhere. Icon image need correct size still, layer-in-use icon needs remake.
- Macbook retina support, use command line --no-native-pixels to disable it
- Timeline Marker label was drawing wrong
- Trackpad and magic mouse: supports zoom (hold ctrl)
- Fix for splash position: removed ghost function and made window size update after creation immediate
- Fast undo buffer save now adds UI as well. Could be checked for regular file save even...
Quit.blend and temp file saving use this now.
- Dixed filename in window on reading quit.blend or temp saves, and they now add a warning in window title: "(Recovered)"
- New Userpref option "Keep Session" - this always saves quit.blend, and loads on start.
This allows keeping UI and data without actual saves, until you actually save.
When you load startup.blend and quit, it recognises the quit.blend as a startup (no file name in header)
- Added 3D view copy/paste buffers (selected objects). Shortcuts ctrl-c, ctrl-v (OSX, cmd-c, cmd-v).
Coded partial file saving for it. Could be used for other purposes. Todo: use OS clipboards.
- User preferences (themes, keymaps, user settings) now can be saved as a separate file.
Old option is called "Save Startup File" the new one "Save User Settings".
To visualise this difference, the 'save startup file' button has been removed from user preferences window. That option is available as CTRL+U and in File menu still.
- OSX: fixed bug that stopped giving mouse events outside window.
This also fixes "Continuous Grab" for OSX. (error since 2009)
2012-12-12 18:58:11 +00:00
|
|
|
ar->drawrct = ar->winrct;
|
2013-08-05 04:52:27 +00:00
|
|
|
scissor_pad = true;
|
|
|
|
}
|
2.5
Summary of ain features:
- Themes and Styles are now editable.
- CTRL+U "Save user defaults" now goes to new .B25.blend, so you
can use 2.4x and 2.5x next to each other. If B25 doesn't exist, it
reads the regular .B.blend
- Press Tkey in 3d window for (unfinished) toolbar WIP. It now only
shows the last operator, if appropriate.
Nkey properties moved to the other side.
A lot of work was done on removing old themes for good and properly
getting it work with the 2.5 region system. Here's some notes;
- Buttons now all have a complete set of colors, based on button classifications
(See outliner -> user prefs -> Interface
- Theme colors have been extended with basic colors for region types.
Currently colors are defined for Window, Header, List/Channels and
for Button/Tool views.
The screen manager handles this btw, so a TH_BACK will always pick the
right backdrop color.
- Menu backdrops are in in Button theme colors. Floating Panels will be in
the per-space type Themes.
- Styles were added in RNA too, but only for the font settings now.
Only Panel font, widget font and widget-label work now. The 'group label'
will be for templates mostly.
Style settings will be expanded with spacing defaults, label conventions,
etc.
- Label text colors are stored in per-space Theme too, to make sure they fit.
Same goes for Panel title color.
Note that 'shadow' for fonts can conflict with text colors; shadow color is
currently stored in Style... shadow code needs a bit of work still.
2009-04-27 13:44:11 +00:00
|
|
|
else {
|
2013-08-05 04:19:34 +00:00
|
|
|
/* extra clip for safety */
|
|
|
|
BLI_rcti_isect(&ar->winrct, &ar->drawrct, &ar->drawrct);
|
2013-08-05 04:52:27 +00:00
|
|
|
scissor_pad = false;
|
2.5
Summary of ain features:
- Themes and Styles are now editable.
- CTRL+U "Save user defaults" now goes to new .B25.blend, so you
can use 2.4x and 2.5x next to each other. If B25 doesn't exist, it
reads the regular .B.blend
- Press Tkey in 3d window for (unfinished) toolbar WIP. It now only
shows the last operator, if appropriate.
Nkey properties moved to the other side.
A lot of work was done on removing old themes for good and properly
getting it work with the 2.5 region system. Here's some notes;
- Buttons now all have a complete set of colors, based on button classifications
(See outliner -> user prefs -> Interface
- Theme colors have been extended with basic colors for region types.
Currently colors are defined for Window, Header, List/Channels and
for Button/Tool views.
The screen manager handles this btw, so a TH_BACK will always pick the
right backdrop color.
- Menu backdrops are in in Button theme colors. Floating Panels will be in
the per-space type Themes.
- Styles were added in RNA too, but only for the font settings now.
Only Panel font, widget font and widget-label work now. The 'group label'
will be for templates mostly.
Style settings will be expanded with spacing defaults, label conventions,
etc.
- Label text colors are stored in per-space Theme too, to make sure they fit.
Same goes for Panel title color.
Note that 'shadow' for fonts can conflict with text colors; shadow color is
currently stored in Style... shadow code needs a bit of work still.
2009-04-27 13:44:11 +00:00
|
|
|
}
|
2013-12-18 12:02:31 +01:00
|
|
|
|
|
|
|
ar->do_draw |= RGN_DRAWING;
|
2008-01-07 18:03:41 +00:00
|
|
|
|
2008-12-19 14:14:43 +00:00
|
|
|
/* note; this sets state, so we can use wmOrtho and friends */
|
2013-08-05 04:52:27 +00:00
|
|
|
wmSubWindowScissorSet(win, ar->swinid, &ar->drawrct, scissor_pad);
|
2014-09-10 13:34:17 +10:00
|
|
|
|
|
|
|
wmOrtho2_region_ui(ar);
|
2008-01-07 18:03:41 +00:00
|
|
|
|
2013-07-27 16:39:00 +00:00
|
|
|
UI_SetTheme(sa ? sa->spacetype : 0, at->regionid);
|
2.5
Summary of ain features:
- Themes and Styles are now editable.
- CTRL+U "Save user defaults" now goes to new .B25.blend, so you
can use 2.4x and 2.5x next to each other. If B25 doesn't exist, it
reads the regular .B.blend
- Press Tkey in 3d window for (unfinished) toolbar WIP. It now only
shows the last operator, if appropriate.
Nkey properties moved to the other side.
A lot of work was done on removing old themes for good and properly
getting it work with the 2.5 region system. Here's some notes;
- Buttons now all have a complete set of colors, based on button classifications
(See outliner -> user prefs -> Interface
- Theme colors have been extended with basic colors for region types.
Currently colors are defined for Window, Header, List/Channels and
for Button/Tool views.
The screen manager handles this btw, so a TH_BACK will always pick the
right backdrop color.
- Menu backdrops are in in Button theme colors. Floating Panels will be in
the per-space type Themes.
- Styles were added in RNA too, but only for the font settings now.
Only Panel font, widget font and widget-label work now. The 'group label'
will be for templates mostly.
Style settings will be expanded with spacing defaults, label conventions,
etc.
- Label text colors are stored in per-space Theme too, to make sure they fit.
Same goes for Panel title color.
Note that 'shadow' for fonts can conflict with text colors; shadow color is
currently stored in Style... shadow code needs a bit of work still.
2009-04-27 13:44:11 +00:00
|
|
|
|
2.5
Vertex Paint back!
Added WM level "paint cursor" system, which manages a custom painting
cursor for tools or modes.
- Activate it with WM_paint_cursor_activate(). That function wants two
callbacks, a poll(C) to check whether there's a cursor in given context
and ARegion, and a draw(C, x, y) which gets called when appropriate.
- While paintcursor is active, the WM handles necessary redrawing events
for all regions, also to nicely clear the cursor on region exit.
- WM_paint_cursor_activate returns a handle, which you have to use to
end the paint cursor. This handle also means you can register as many
custom cursors as you want.
At the moment, vertex paint mode registers only a mousemove handler,
all other events are still normally handled. This is stuff for the
future todo.
2009-01-09 13:55:45 +00:00
|
|
|
/* optional header info instead? */
|
2012-03-24 06:38:07 +00:00
|
|
|
if (ar->headerstr) {
|
2010-04-06 07:02:16 +00:00
|
|
|
UI_ThemeClearColor(TH_HEADER);
|
2.5
Vertex Paint back!
Added WM level "paint cursor" system, which manages a custom painting
cursor for tools or modes.
- Activate it with WM_paint_cursor_activate(). That function wants two
callbacks, a poll(C) to check whether there's a cursor in given context
and ARegion, and a draw(C, x, y) which gets called when appropriate.
- While paintcursor is active, the WM handles necessary redrawing events
for all regions, also to nicely clear the cursor on region exit.
- WM_paint_cursor_activate returns a handle, which you have to use to
end the paint cursor. This handle also means you can register as many
custom cursors as you want.
At the moment, vertex paint mode registers only a mousemove handler,
all other events are still normally handled. This is stuff for the
future todo.
2009-01-09 13:55:45 +00:00
|
|
|
glClear(GL_COLOR_BUFFER_BIT);
|
2008-11-27 17:58:46 +00:00
|
|
|
|
2.5
Summary of ain features:
- Themes and Styles are now editable.
- CTRL+U "Save user defaults" now goes to new .B25.blend, so you
can use 2.4x and 2.5x next to each other. If B25 doesn't exist, it
reads the regular .B.blend
- Press Tkey in 3d window for (unfinished) toolbar WIP. It now only
shows the last operator, if appropriate.
Nkey properties moved to the other side.
A lot of work was done on removing old themes for good and properly
getting it work with the 2.5 region system. Here's some notes;
- Buttons now all have a complete set of colors, based on button classifications
(See outliner -> user prefs -> Interface
- Theme colors have been extended with basic colors for region types.
Currently colors are defined for Window, Header, List/Channels and
for Button/Tool views.
The screen manager handles this btw, so a TH_BACK will always pick the
right backdrop color.
- Menu backdrops are in in Button theme colors. Floating Panels will be in
the per-space type Themes.
- Styles were added in RNA too, but only for the font settings now.
Only Panel font, widget font and widget-label work now. The 'group label'
will be for templates mostly.
Style settings will be expanded with spacing defaults, label conventions,
etc.
- Label text colors are stored in per-space Theme too, to make sure they fit.
Same goes for Panel title color.
Note that 'shadow' for fonts can conflict with text colors; shadow color is
currently stored in Style... shadow code needs a bit of work still.
2009-04-27 13:44:11 +00:00
|
|
|
UI_ThemeColor(TH_TEXT);
|
2013-02-22 00:51:58 +00:00
|
|
|
BLF_draw_default(UI_UNIT_X, 0.4f * UI_UNIT_Y, 0.0f, ar->headerstr, BLF_DRAW_STR_DUMMY_MAX);
|
2.5
Vertex Paint back!
Added WM level "paint cursor" system, which manages a custom painting
cursor for tools or modes.
- Activate it with WM_paint_cursor_activate(). That function wants two
callbacks, a poll(C) to check whether there's a cursor in given context
and ARegion, and a draw(C, x, y) which gets called when appropriate.
- While paintcursor is active, the WM handles necessary redrawing events
for all regions, also to nicely clear the cursor on region exit.
- WM_paint_cursor_activate returns a handle, which you have to use to
end the paint cursor. This handle also means you can register as many
custom cursors as you want.
At the moment, vertex paint mode registers only a mousemove handler,
all other events are still normally handled. This is stuff for the
future todo.
2009-01-09 13:55:45 +00:00
|
|
|
}
|
2012-03-24 06:38:07 +00:00
|
|
|
else if (at->draw) {
|
2.5
Vertex Paint back!
Added WM level "paint cursor" system, which manages a custom painting
cursor for tools or modes.
- Activate it with WM_paint_cursor_activate(). That function wants two
callbacks, a poll(C) to check whether there's a cursor in given context
and ARegion, and a draw(C, x, y) which gets called when appropriate.
- While paintcursor is active, the WM handles necessary redrawing events
for all regions, also to nicely clear the cursor on region exit.
- WM_paint_cursor_activate returns a handle, which you have to use to
end the paint cursor. This handle also means you can register as many
custom cursors as you want.
At the moment, vertex paint mode registers only a mousemove handler,
all other events are still normally handled. This is stuff for the
future todo.
2009-01-09 13:55:45 +00:00
|
|
|
at->draw(C, ar);
|
2008-01-07 18:03:41 +00:00
|
|
|
}
|
2010-08-06 18:11:49 +00:00
|
|
|
|
2011-11-04 21:29:28 +00:00
|
|
|
/* XXX test: add convention to end regions always in pixel space, for drawing of borders/gestures etc */
|
|
|
|
ED_region_pixelspace(ar);
|
|
|
|
|
2010-08-06 18:11:49 +00:00
|
|
|
ED_region_draw_cb_draw(C, ar, REGION_DRAW_POST_PIXEL);
|
2012-03-06 14:48:11 +00:00
|
|
|
|
2013-05-15 17:59:55 +00:00
|
|
|
region_draw_azones(sa, ar);
|
|
|
|
|
2013-05-13 13:32:42 +00:00
|
|
|
/* for debugging unneeded area redraws and partial redraw */
|
|
|
|
#if 0
|
|
|
|
glEnable(GL_BLEND);
|
|
|
|
glColor4f(drand48(), drand48(), drand48(), 0.1f);
|
2013-05-13 14:17:58 +00:00
|
|
|
glRectf(ar->drawrct.xmin - ar->winrct.xmin, ar->drawrct.ymin - ar->winrct.ymin,
|
2013-05-14 06:58:35 +00:00
|
|
|
ar->drawrct.xmax - ar->winrct.xmin, ar->drawrct.ymax - ar->winrct.ymin);
|
2013-05-13 13:32:42 +00:00
|
|
|
glDisable(GL_BLEND);
|
|
|
|
#endif
|
|
|
|
|
2012-03-06 14:48:11 +00:00
|
|
|
memset(&ar->drawrct, 0, sizeof(ar->drawrct));
|
2.5: work on bringing back SpaceTime options
- RMB select, also with SHIFT
- RMB tweak for translate
- SHIFT+D dupli
- BKEY border select/deselect
- AKEY (de)select all
- XKEY delete
- GKEY grab
Added some XXX comments for future todos, especially for when other
spaces come back with time markers.
Also added ED_util for putting in all to-be-cleaned cruft
Context conflict: input methods for Markers can conflict with other
spacetypes. It was solved in pre-2.5 with manually tweaking it all over,
but I would prefer one keymap for all marker stuff. Needs some thinking...
could be solved with a boundbox check for bottom part of 2d window.
Tweak issue: both tweak styles are possible:
- Hold mouse button, move, operator ends on mouse release
- Hold mouse button, move, operator ends on mouse click
Problem is that modally handled operators use fixed keymaps... like ESC,
SPACE, ENTER, or press/release mousebutton for 'assign'. There's a lot
to say for making this all consistant, or become part of 1 general keymap?
Should also be possibe to define 'tweak' defaults for Tablet different
than for mouse...
2008-11-29 15:10:31 +00:00
|
|
|
|
2014-11-09 21:20:40 +01:00
|
|
|
UI_blocklist_free_inactive(C, &ar->uiblocks);
|
2011-11-04 21:29:28 +00:00
|
|
|
|
2014-10-17 00:12:31 +02:00
|
|
|
if (sa && (win->screen->state != SCREENFULL)) {
|
Holiday coding log :)
Nice formatted version (pictures soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.66/Usability
Short list of main changes:
- Transparent region option (over main region), added code to blend in/out such panels.
- Min size window now 640 x 480
- Fixed DPI for ui - lots of cleanup and changes everywhere. Icon image need correct size still, layer-in-use icon needs remake.
- Macbook retina support, use command line --no-native-pixels to disable it
- Timeline Marker label was drawing wrong
- Trackpad and magic mouse: supports zoom (hold ctrl)
- Fix for splash position: removed ghost function and made window size update after creation immediate
- Fast undo buffer save now adds UI as well. Could be checked for regular file save even...
Quit.blend and temp file saving use this now.
- Dixed filename in window on reading quit.blend or temp saves, and they now add a warning in window title: "(Recovered)"
- New Userpref option "Keep Session" - this always saves quit.blend, and loads on start.
This allows keeping UI and data without actual saves, until you actually save.
When you load startup.blend and quit, it recognises the quit.blend as a startup (no file name in header)
- Added 3D view copy/paste buffers (selected objects). Shortcuts ctrl-c, ctrl-v (OSX, cmd-c, cmd-v).
Coded partial file saving for it. Could be used for other purposes. Todo: use OS clipboards.
- User preferences (themes, keymaps, user settings) now can be saved as a separate file.
Old option is called "Save Startup File" the new one "Save User Settings".
To visualise this difference, the 'save startup file' button has been removed from user preferences window. That option is available as CTRL+U and in File menu still.
- OSX: fixed bug that stopped giving mouse events outside window.
This also fixes "Continuous Grab" for OSX. (error since 2009)
2012-12-12 18:58:11 +00:00
|
|
|
region_draw_emboss(ar, &ar->winrct);
|
2014-10-17 00:12:31 +02:00
|
|
|
}
|
2008-01-07 18:03:41 +00:00
|
|
|
}
|
|
|
|
|
2008-12-16 12:28:00 +00:00
|
|
|
/* **********************************
|
2012-03-03 16:31:46 +00:00
|
|
|
* maybe silly, but let's try for now
|
|
|
|
* to keep these tags protected
|
|
|
|
* ********************************** */
|
2008-12-16 12:28:00 +00:00
|
|
|
|
|
|
|
void ED_region_tag_redraw(ARegion *ar)
|
|
|
|
{
|
2013-12-18 12:02:31 +01:00
|
|
|
/* don't tag redraw while drawing, it shouldn't happen normally
|
|
|
|
* but python scripts can cause this to happen indirectly */
|
|
|
|
if (ar && !(ar->do_draw & RGN_DRAWING)) {
|
2.5: WM Compositing
* Triple Buffer is now more complete:
- Proper handling of window resize, duplicate, etc.
- It now uses 3x3 textures (or less) if the power of two sizes
do not match well. That still has a worst case wast of 23.4%,
but better than 300%.
- It can also use the ARB/NV/EXT_texture_rectangle extension
now, which may be supported on hardware that does not support
ARB_texture_non_power_of_two.
- Gesture, menu and brushe redraws now require no redraws at all
from the area regions. So even on a high poly scene just moving
the paint cursor or opening a menu should be fast.
* Testing can be done by setting the "Window Draw Method" in the
User Preferences in the outliner. "Overlap" is still default,
since "Triple Buffer" has not been tested on computers other than
mine, would like to avoid crashing Blender on startup in case
there is a common bug, but it's ready for testing now.
- For reference "Full" draws the full window each time.
- "Triple Buffer" should work for both swap copy and swap exchange
systems, the latter still need the -E command line option for
"Overlap".
- Resizing and going fullscreen still gives flicker here but no
more than "Full" drawing.
* Partial Redraw was added. ED_region_tag_redraw_partial takes a
rect in window coordinates to define a subarea of the region.
On region draw it will then set glScissor to a smaller area, and
ar->drawrct will always be set to either the partial or full
window rect. The latter can then be used for clipping in the 3D
view or clipping interface drawing. Neither is implemented yet.
2009-01-23 03:52:52 +00:00
|
|
|
/* zero region means full region redraw */
|
2014-07-19 08:11:52 +10:00
|
|
|
ar->do_draw &= ~RGN_DRAW_PARTIAL;
|
|
|
|
ar->do_draw |= RGN_DRAW;
|
2.5: WM Compositing
* Triple Buffer is now more complete:
- Proper handling of window resize, duplicate, etc.
- It now uses 3x3 textures (or less) if the power of two sizes
do not match well. That still has a worst case wast of 23.4%,
but better than 300%.
- It can also use the ARB/NV/EXT_texture_rectangle extension
now, which may be supported on hardware that does not support
ARB_texture_non_power_of_two.
- Gesture, menu and brushe redraws now require no redraws at all
from the area regions. So even on a high poly scene just moving
the paint cursor or opening a menu should be fast.
* Testing can be done by setting the "Window Draw Method" in the
User Preferences in the outliner. "Overlap" is still default,
since "Triple Buffer" has not been tested on computers other than
mine, would like to avoid crashing Blender on startup in case
there is a common bug, but it's ready for testing now.
- For reference "Full" draws the full window each time.
- "Triple Buffer" should work for both swap copy and swap exchange
systems, the latter still need the -E command line option for
"Overlap".
- Resizing and going fullscreen still gives flicker here but no
more than "Full" drawing.
* Partial Redraw was added. ED_region_tag_redraw_partial takes a
rect in window coordinates to define a subarea of the region.
On region draw it will then set glScissor to a smaller area, and
ar->drawrct will always be set to either the partial or full
window rect. The latter can then be used for clipping in the 3D
view or clipping interface drawing. Neither is implemented yet.
2009-01-23 03:52:52 +00:00
|
|
|
memset(&ar->drawrct, 0, sizeof(ar->drawrct));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-06-23 09:58:32 +00:00
|
|
|
void ED_region_tag_redraw_overlay(ARegion *ar)
|
|
|
|
{
|
2012-03-24 06:38:07 +00:00
|
|
|
if (ar)
|
2012-05-08 15:43:59 +00:00
|
|
|
ar->do_draw_overlay = RGN_DRAW;
|
2010-06-23 09:58:32 +00:00
|
|
|
}
|
|
|
|
|
2014-06-15 01:40:15 +10:00
|
|
|
void ED_region_tag_refresh_ui(ARegion *ar)
|
|
|
|
{
|
|
|
|
if (ar) {
|
|
|
|
ar->do_draw |= RGN_DRAW_REFRESH_UI;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-06-30 15:31:55 +10:00
|
|
|
void ED_region_tag_redraw_partial(ARegion *ar, const rcti *rct)
|
2.5: WM Compositing
* Triple Buffer is now more complete:
- Proper handling of window resize, duplicate, etc.
- It now uses 3x3 textures (or less) if the power of two sizes
do not match well. That still has a worst case wast of 23.4%,
but better than 300%.
- It can also use the ARB/NV/EXT_texture_rectangle extension
now, which may be supported on hardware that does not support
ARB_texture_non_power_of_two.
- Gesture, menu and brushe redraws now require no redraws at all
from the area regions. So even on a high poly scene just moving
the paint cursor or opening a menu should be fast.
* Testing can be done by setting the "Window Draw Method" in the
User Preferences in the outliner. "Overlap" is still default,
since "Triple Buffer" has not been tested on computers other than
mine, would like to avoid crashing Blender on startup in case
there is a common bug, but it's ready for testing now.
- For reference "Full" draws the full window each time.
- "Triple Buffer" should work for both swap copy and swap exchange
systems, the latter still need the -E command line option for
"Overlap".
- Resizing and going fullscreen still gives flicker here but no
more than "Full" drawing.
* Partial Redraw was added. ED_region_tag_redraw_partial takes a
rect in window coordinates to define a subarea of the region.
On region draw it will then set glScissor to a smaller area, and
ar->drawrct will always be set to either the partial or full
window rect. The latter can then be used for clipping in the 3D
view or clipping interface drawing. Neither is implemented yet.
2009-01-23 03:52:52 +00:00
|
|
|
{
|
2013-12-18 12:02:31 +01:00
|
|
|
if (ar && !(ar->do_draw & RGN_DRAWING)) {
|
2014-07-19 08:11:52 +10:00
|
|
|
if (!(ar->do_draw & RGN_DRAW)) {
|
2.5: WM Compositing
* Triple Buffer is now more complete:
- Proper handling of window resize, duplicate, etc.
- It now uses 3x3 textures (or less) if the power of two sizes
do not match well. That still has a worst case wast of 23.4%,
but better than 300%.
- It can also use the ARB/NV/EXT_texture_rectangle extension
now, which may be supported on hardware that does not support
ARB_texture_non_power_of_two.
- Gesture, menu and brushe redraws now require no redraws at all
from the area regions. So even on a high poly scene just moving
the paint cursor or opening a menu should be fast.
* Testing can be done by setting the "Window Draw Method" in the
User Preferences in the outliner. "Overlap" is still default,
since "Triple Buffer" has not been tested on computers other than
mine, would like to avoid crashing Blender on startup in case
there is a common bug, but it's ready for testing now.
- For reference "Full" draws the full window each time.
- "Triple Buffer" should work for both swap copy and swap exchange
systems, the latter still need the -E command line option for
"Overlap".
- Resizing and going fullscreen still gives flicker here but no
more than "Full" drawing.
* Partial Redraw was added. ED_region_tag_redraw_partial takes a
rect in window coordinates to define a subarea of the region.
On region draw it will then set glScissor to a smaller area, and
ar->drawrct will always be set to either the partial or full
window rect. The latter can then be used for clipping in the 3D
view or clipping interface drawing. Neither is implemented yet.
2009-01-23 03:52:52 +00:00
|
|
|
/* no redraw set yet, set partial region */
|
2014-07-19 08:11:52 +10:00
|
|
|
ar->do_draw |= RGN_DRAW_PARTIAL;
|
2012-05-08 15:43:59 +00:00
|
|
|
ar->drawrct = *rct;
|
2.5: WM Compositing
* Triple Buffer is now more complete:
- Proper handling of window resize, duplicate, etc.
- It now uses 3x3 textures (or less) if the power of two sizes
do not match well. That still has a worst case wast of 23.4%,
but better than 300%.
- It can also use the ARB/NV/EXT_texture_rectangle extension
now, which may be supported on hardware that does not support
ARB_texture_non_power_of_two.
- Gesture, menu and brushe redraws now require no redraws at all
from the area regions. So even on a high poly scene just moving
the paint cursor or opening a menu should be fast.
* Testing can be done by setting the "Window Draw Method" in the
User Preferences in the outliner. "Overlap" is still default,
since "Triple Buffer" has not been tested on computers other than
mine, would like to avoid crashing Blender on startup in case
there is a common bug, but it's ready for testing now.
- For reference "Full" draws the full window each time.
- "Triple Buffer" should work for both swap copy and swap exchange
systems, the latter still need the -E command line option for
"Overlap".
- Resizing and going fullscreen still gives flicker here but no
more than "Full" drawing.
* Partial Redraw was added. ED_region_tag_redraw_partial takes a
rect in window coordinates to define a subarea of the region.
On region draw it will then set glScissor to a smaller area, and
ar->drawrct will always be set to either the partial or full
window rect. The latter can then be used for clipping in the 3D
view or clipping interface drawing. Neither is implemented yet.
2009-01-23 03:52:52 +00:00
|
|
|
}
|
2012-03-24 06:38:07 +00:00
|
|
|
else if (ar->drawrct.xmin != ar->drawrct.xmax) {
|
2.5: WM Compositing
* Triple Buffer is now more complete:
- Proper handling of window resize, duplicate, etc.
- It now uses 3x3 textures (or less) if the power of two sizes
do not match well. That still has a worst case wast of 23.4%,
but better than 300%.
- It can also use the ARB/NV/EXT_texture_rectangle extension
now, which may be supported on hardware that does not support
ARB_texture_non_power_of_two.
- Gesture, menu and brushe redraws now require no redraws at all
from the area regions. So even on a high poly scene just moving
the paint cursor or opening a menu should be fast.
* Testing can be done by setting the "Window Draw Method" in the
User Preferences in the outliner. "Overlap" is still default,
since "Triple Buffer" has not been tested on computers other than
mine, would like to avoid crashing Blender on startup in case
there is a common bug, but it's ready for testing now.
- For reference "Full" draws the full window each time.
- "Triple Buffer" should work for both swap copy and swap exchange
systems, the latter still need the -E command line option for
"Overlap".
- Resizing and going fullscreen still gives flicker here but no
more than "Full" drawing.
* Partial Redraw was added. ED_region_tag_redraw_partial takes a
rect in window coordinates to define a subarea of the region.
On region draw it will then set glScissor to a smaller area, and
ar->drawrct will always be set to either the partial or full
window rect. The latter can then be used for clipping in the 3D
view or clipping interface drawing. Neither is implemented yet.
2009-01-23 03:52:52 +00:00
|
|
|
/* partial redraw already set, expand region */
|
2012-10-24 05:06:40 +00:00
|
|
|
BLI_rcti_union(&ar->drawrct, rct);
|
2.5: WM Compositing
* Triple Buffer is now more complete:
- Proper handling of window resize, duplicate, etc.
- It now uses 3x3 textures (or less) if the power of two sizes
do not match well. That still has a worst case wast of 23.4%,
but better than 300%.
- It can also use the ARB/NV/EXT_texture_rectangle extension
now, which may be supported on hardware that does not support
ARB_texture_non_power_of_two.
- Gesture, menu and brushe redraws now require no redraws at all
from the area regions. So even on a high poly scene just moving
the paint cursor or opening a menu should be fast.
* Testing can be done by setting the "Window Draw Method" in the
User Preferences in the outliner. "Overlap" is still default,
since "Triple Buffer" has not been tested on computers other than
mine, would like to avoid crashing Blender on startup in case
there is a common bug, but it's ready for testing now.
- For reference "Full" draws the full window each time.
- "Triple Buffer" should work for both swap copy and swap exchange
systems, the latter still need the -E command line option for
"Overlap".
- Resizing and going fullscreen still gives flicker here but no
more than "Full" drawing.
* Partial Redraw was added. ED_region_tag_redraw_partial takes a
rect in window coordinates to define a subarea of the region.
On region draw it will then set glScissor to a smaller area, and
ar->drawrct will always be set to either the partial or full
window rect. The latter can then be used for clipping in the 3D
view or clipping interface drawing. Neither is implemented yet.
2009-01-23 03:52:52 +00:00
|
|
|
}
|
|
|
|
}
|
2008-12-16 12:28:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void ED_area_tag_redraw(ScrArea *sa)
|
|
|
|
{
|
|
|
|
ARegion *ar;
|
|
|
|
|
2012-03-24 06:38:07 +00:00
|
|
|
if (sa)
|
2012-05-08 15:43:59 +00:00
|
|
|
for (ar = sa->regionbase.first; ar; ar = ar->next)
|
2.5: WM Compositing
* Triple Buffer is now more complete:
- Proper handling of window resize, duplicate, etc.
- It now uses 3x3 textures (or less) if the power of two sizes
do not match well. That still has a worst case wast of 23.4%,
but better than 300%.
- It can also use the ARB/NV/EXT_texture_rectangle extension
now, which may be supported on hardware that does not support
ARB_texture_non_power_of_two.
- Gesture, menu and brushe redraws now require no redraws at all
from the area regions. So even on a high poly scene just moving
the paint cursor or opening a menu should be fast.
* Testing can be done by setting the "Window Draw Method" in the
User Preferences in the outliner. "Overlap" is still default,
since "Triple Buffer" has not been tested on computers other than
mine, would like to avoid crashing Blender on startup in case
there is a common bug, but it's ready for testing now.
- For reference "Full" draws the full window each time.
- "Triple Buffer" should work for both swap copy and swap exchange
systems, the latter still need the -E command line option for
"Overlap".
- Resizing and going fullscreen still gives flicker here but no
more than "Full" drawing.
* Partial Redraw was added. ED_region_tag_redraw_partial takes a
rect in window coordinates to define a subarea of the region.
On region draw it will then set glScissor to a smaller area, and
ar->drawrct will always be set to either the partial or full
window rect. The latter can then be used for clipping in the 3D
view or clipping interface drawing. Neither is implemented yet.
2009-01-23 03:52:52 +00:00
|
|
|
ED_region_tag_redraw(ar);
|
2008-12-16 12:28:00 +00:00
|
|
|
}
|
|
|
|
|
2010-10-20 04:12:01 +00:00
|
|
|
void ED_area_tag_redraw_regiontype(ScrArea *sa, int regiontype)
|
|
|
|
{
|
|
|
|
ARegion *ar;
|
|
|
|
|
2012-03-24 06:38:07 +00:00
|
|
|
if (sa) {
|
2012-05-08 15:43:59 +00:00
|
|
|
for (ar = sa->regionbase.first; ar; ar = ar->next) {
|
2012-03-24 06:38:07 +00:00
|
|
|
if (ar->regiontype == regiontype) {
|
2010-10-20 04:12:01 +00:00
|
|
|
ED_region_tag_redraw(ar);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-01-04 17:45:54 +00:00
|
|
|
void ED_area_tag_refresh(ScrArea *sa)
|
|
|
|
{
|
2012-03-24 06:38:07 +00:00
|
|
|
if (sa)
|
2014-04-01 11:34:00 +11:00
|
|
|
sa->do_refresh = true;
|
2009-01-04 17:45:54 +00:00
|
|
|
}
|
2008-12-16 12:28:00 +00:00
|
|
|
|
2008-12-21 17:18:36 +00:00
|
|
|
/* *************************************************************** */
|
|
|
|
|
|
|
|
/* use NULL to disable it */
|
2010-11-17 09:45:45 +00:00
|
|
|
void ED_area_headerprint(ScrArea *sa, const char *str)
|
2008-12-21 17:18:36 +00:00
|
|
|
{
|
|
|
|
ARegion *ar;
|
2011-03-22 09:14:27 +00:00
|
|
|
|
|
|
|
/* happens when running transform operators in backround mode */
|
2012-03-24 06:38:07 +00:00
|
|
|
if (sa == NULL)
|
2011-03-22 09:14:27 +00:00
|
|
|
return;
|
|
|
|
|
2012-05-08 15:43:59 +00:00
|
|
|
for (ar = sa->regionbase.first; ar; ar = ar->next) {
|
|
|
|
if (ar->regiontype == RGN_TYPE_HEADER) {
|
2012-03-24 06:38:07 +00:00
|
|
|
if (str) {
|
2012-05-08 15:43:59 +00:00
|
|
|
if (ar->headerstr == NULL)
|
|
|
|
ar->headerstr = MEM_mallocN(256, "headerprint");
|
2008-12-21 17:18:36 +00:00
|
|
|
BLI_strncpy(ar->headerstr, str, 256);
|
|
|
|
}
|
2012-03-24 06:38:07 +00:00
|
|
|
else if (ar->headerstr) {
|
2008-12-21 17:18:36 +00:00
|
|
|
MEM_freeN(ar->headerstr);
|
2012-05-08 15:43:59 +00:00
|
|
|
ar->headerstr = NULL;
|
2008-12-21 17:18:36 +00:00
|
|
|
}
|
|
|
|
ED_region_tag_redraw(ar);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2008-12-16 12:28:00 +00:00
|
|
|
|
2.5
First version of region-scaling. WIP commit, so bear with me a while!
- All fixed sized regions have a small 'drag' widget, on the left or top.
(not yet for free-sized regions, like 4-split).
- Mouse-over on widget changes cursor and allows drag.
- Click on widget hides/reveals.
- Fun for test; 3d view header, if high enough, draws more rows of
buttons when width is too small.
The WIP stuff;
- It doesn't save yet in files, using the "minsize" variable of region
definitions, also means other similar areas show same sizes now.
- Definitions for pref size, min/max will be added.
- Properties panel in Fcurve window draws widget on wrong place when
hidden (subdiv system needs tweak)
- Widgets don't draw perfect yet, also needs further tweaks.
But, in general it's quite fun and usable. :) Many variatians are possible,
like for real tabs, or little icons, or just click-drag on edge.
The reason to first try the widget/tab variation:
- it re-uses the "Area Action Zone" code, widgets for layouting Screens
- it's visible, hotkey-only options for screen layouts are not preferred.
- distinguish clearly area-edges from region-edges this way. Having the
cursor change shape on every edge (and block input) is probably annoying
too... but that can be tested.
Later more!
2009-05-24 13:29:29 +00:00
|
|
|
/* ************************************************************ */
|
|
|
|
|
|
|
|
|
2014-02-27 23:39:40 +01:00
|
|
|
static void area_azone_initialize(wmWindow *win, bScreen *screen, ScrArea *sa)
|
2.5
First version of region-scaling. WIP commit, so bear with me a while!
- All fixed sized regions have a small 'drag' widget, on the left or top.
(not yet for free-sized regions, like 4-split).
- Mouse-over on widget changes cursor and allows drag.
- Click on widget hides/reveals.
- Fun for test; 3d view header, if high enough, draws more rows of
buttons when width is too small.
The WIP stuff;
- It doesn't save yet in files, using the "minsize" variable of region
definitions, also means other similar areas show same sizes now.
- Definitions for pref size, min/max will be added.
- Properties panel in Fcurve window draws widget on wrong place when
hidden (subdiv system needs tweak)
- Widgets don't draw perfect yet, also needs further tweaks.
But, in general it's quite fun and usable. :) Many variatians are possible,
like for real tabs, or little icons, or just click-drag on edge.
The reason to first try the widget/tab variation:
- it re-uses the "Area Action Zone" code, widgets for layouting Screens
- it's visible, hotkey-only options for screen layouts are not preferred.
- distinguish clearly area-edges from region-edges this way. Having the
cursor change shape on every edge (and block input) is probably annoying
too... but that can be tested.
Later more!
2009-05-24 13:29:29 +00:00
|
|
|
{
|
|
|
|
AZone *az;
|
|
|
|
|
2014-10-14 15:05:44 -03:00
|
|
|
/* reinitalize entirely, regions and fullscreen add azones too */
|
2.5
First version of region-scaling. WIP commit, so bear with me a while!
- All fixed sized regions have a small 'drag' widget, on the left or top.
(not yet for free-sized regions, like 4-split).
- Mouse-over on widget changes cursor and allows drag.
- Click on widget hides/reveals.
- Fun for test; 3d view header, if high enough, draws more rows of
buttons when width is too small.
The WIP stuff;
- It doesn't save yet in files, using the "minsize" variable of region
definitions, also means other similar areas show same sizes now.
- Definitions for pref size, min/max will be added.
- Properties panel in Fcurve window draws widget on wrong place when
hidden (subdiv system needs tweak)
- Widgets don't draw perfect yet, also needs further tweaks.
But, in general it's quite fun and usable. :) Many variatians are possible,
like for real tabs, or little icons, or just click-drag on edge.
The reason to first try the widget/tab variation:
- it re-uses the "Area Action Zone" code, widgets for layouting Screens
- it's visible, hotkey-only options for screen layouts are not preferred.
- distinguish clearly area-edges from region-edges this way. Having the
cursor change shape on every edge (and block input) is probably annoying
too... but that can be tested.
Later more!
2009-05-24 13:29:29 +00:00
|
|
|
BLI_freelistN(&sa->actionzones);
|
2012-08-11 00:05:57 +00:00
|
|
|
|
2014-10-14 15:05:44 -03:00
|
|
|
if (screen->state != SCREENNORMAL) {
|
2012-08-11 00:05:57 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2014-02-27 23:39:40 +01:00
|
|
|
/* can't click on bottom corners on OS X, already used for resizing */
|
|
|
|
#ifdef __APPLE__
|
2014-02-28 11:04:15 +11:00
|
|
|
if (!(sa->totrct.xmin == 0 && sa->totrct.ymin == 0) || WM_window_is_fullscreen(win))
|
|
|
|
#else
|
|
|
|
(void)win;
|
2014-02-27 23:39:40 +01:00
|
|
|
#endif
|
|
|
|
{
|
|
|
|
/* set area action zones */
|
|
|
|
az = (AZone *)MEM_callocN(sizeof(AZone), "actionzone");
|
|
|
|
BLI_addtail(&(sa->actionzones), az);
|
|
|
|
az->type = AZONE_AREA;
|
|
|
|
az->x1 = sa->totrct.xmin;
|
|
|
|
az->y1 = sa->totrct.ymin;
|
|
|
|
az->x2 = sa->totrct.xmin + (AZONESPOT - 1);
|
|
|
|
az->y2 = sa->totrct.ymin + (AZONESPOT - 1);
|
|
|
|
BLI_rcti_init(&az->rect, az->x1, az->x2, az->y1, az->y2);
|
|
|
|
}
|
2.5
First version of region-scaling. WIP commit, so bear with me a while!
- All fixed sized regions have a small 'drag' widget, on the left or top.
(not yet for free-sized regions, like 4-split).
- Mouse-over on widget changes cursor and allows drag.
- Click on widget hides/reveals.
- Fun for test; 3d view header, if high enough, draws more rows of
buttons when width is too small.
The WIP stuff;
- It doesn't save yet in files, using the "minsize" variable of region
definitions, also means other similar areas show same sizes now.
- Definitions for pref size, min/max will be added.
- Properties panel in Fcurve window draws widget on wrong place when
hidden (subdiv system needs tweak)
- Widgets don't draw perfect yet, also needs further tweaks.
But, in general it's quite fun and usable. :) Many variatians are possible,
like for real tabs, or little icons, or just click-drag on edge.
The reason to first try the widget/tab variation:
- it re-uses the "Area Action Zone" code, widgets for layouting Screens
- it's visible, hotkey-only options for screen layouts are not preferred.
- distinguish clearly area-edges from region-edges this way. Having the
cursor change shape on every edge (and block input) is probably annoying
too... but that can be tested.
Later more!
2009-05-24 13:29:29 +00:00
|
|
|
|
2012-05-08 15:43:59 +00:00
|
|
|
az = (AZone *)MEM_callocN(sizeof(AZone), "actionzone");
|
2.5
First version of region-scaling. WIP commit, so bear with me a while!
- All fixed sized regions have a small 'drag' widget, on the left or top.
(not yet for free-sized regions, like 4-split).
- Mouse-over on widget changes cursor and allows drag.
- Click on widget hides/reveals.
- Fun for test; 3d view header, if high enough, draws more rows of
buttons when width is too small.
The WIP stuff;
- It doesn't save yet in files, using the "minsize" variable of region
definitions, also means other similar areas show same sizes now.
- Definitions for pref size, min/max will be added.
- Properties panel in Fcurve window draws widget on wrong place when
hidden (subdiv system needs tweak)
- Widgets don't draw perfect yet, also needs further tweaks.
But, in general it's quite fun and usable. :) Many variatians are possible,
like for real tabs, or little icons, or just click-drag on edge.
The reason to first try the widget/tab variation:
- it re-uses the "Area Action Zone" code, widgets for layouting Screens
- it's visible, hotkey-only options for screen layouts are not preferred.
- distinguish clearly area-edges from region-edges this way. Having the
cursor change shape on every edge (and block input) is probably annoying
too... but that can be tested.
Later more!
2009-05-24 13:29:29 +00:00
|
|
|
BLI_addtail(&(sa->actionzones), az);
|
2012-05-08 15:43:59 +00:00
|
|
|
az->type = AZONE_AREA;
|
2013-05-15 12:05:35 +00:00
|
|
|
az->x1 = sa->totrct.xmax;
|
|
|
|
az->y1 = sa->totrct.ymax;
|
2012-05-08 15:43:59 +00:00
|
|
|
az->x2 = sa->totrct.xmax - (AZONESPOT - 1);
|
|
|
|
az->y2 = sa->totrct.ymax - (AZONESPOT - 1);
|
2012-07-12 08:31:23 +00:00
|
|
|
BLI_rcti_init(&az->rect, az->x1, az->x2, az->y1, az->y2);
|
2.5
First version of region-scaling. WIP commit, so bear with me a while!
- All fixed sized regions have a small 'drag' widget, on the left or top.
(not yet for free-sized regions, like 4-split).
- Mouse-over on widget changes cursor and allows drag.
- Click on widget hides/reveals.
- Fun for test; 3d view header, if high enough, draws more rows of
buttons when width is too small.
The WIP stuff;
- It doesn't save yet in files, using the "minsize" variable of region
definitions, also means other similar areas show same sizes now.
- Definitions for pref size, min/max will be added.
- Properties panel in Fcurve window draws widget on wrong place when
hidden (subdiv system needs tweak)
- Widgets don't draw perfect yet, also needs further tweaks.
But, in general it's quite fun and usable. :) Many variatians are possible,
like for real tabs, or little icons, or just click-drag on edge.
The reason to first try the widget/tab variation:
- it re-uses the "Area Action Zone" code, widgets for layouting Screens
- it's visible, hotkey-only options for screen layouts are not preferred.
- distinguish clearly area-edges from region-edges this way. Having the
cursor change shape on every edge (and block input) is probably annoying
too... but that can be tested.
Later more!
2009-05-24 13:29:29 +00:00
|
|
|
}
|
|
|
|
|
2014-10-14 15:05:44 -03:00
|
|
|
static void fullscreen_azone_initialize(ScrArea *sa, ARegion *ar)
|
|
|
|
{
|
|
|
|
AZone *az;
|
|
|
|
|
|
|
|
if (ar->regiontype != RGN_TYPE_WINDOW)
|
|
|
|
return;
|
|
|
|
|
|
|
|
az = (AZone *)MEM_callocN(sizeof(AZone), "fullscreen action zone");
|
|
|
|
BLI_addtail(&(sa->actionzones), az);
|
|
|
|
az->type = AZONE_FULLSCREEN;
|
|
|
|
az->ar = ar;
|
|
|
|
az->alpha = 0.0f;
|
|
|
|
|
|
|
|
az->x1 = ar->winrct.xmax - (AZONEFADEOUT - 1);
|
|
|
|
az->y1 = ar->winrct.ymax - (AZONEFADEOUT - 1);
|
|
|
|
az->x2 = ar->winrct.xmax;
|
|
|
|
az->y2 = ar->winrct.ymax;
|
|
|
|
BLI_rcti_init(&az->rect, az->x1, az->x2, az->y1, az->y2);
|
|
|
|
}
|
|
|
|
|
2013-03-10 14:30:24 +00:00
|
|
|
#define AZONEPAD_EDGE (0.1f * U.widget_unit)
|
Holiday coding log :)
Nice formatted version (pictures soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.66/Usability
Short list of main changes:
- Transparent region option (over main region), added code to blend in/out such panels.
- Min size window now 640 x 480
- Fixed DPI for ui - lots of cleanup and changes everywhere. Icon image need correct size still, layer-in-use icon needs remake.
- Macbook retina support, use command line --no-native-pixels to disable it
- Timeline Marker label was drawing wrong
- Trackpad and magic mouse: supports zoom (hold ctrl)
- Fix for splash position: removed ghost function and made window size update after creation immediate
- Fast undo buffer save now adds UI as well. Could be checked for regular file save even...
Quit.blend and temp file saving use this now.
- Dixed filename in window on reading quit.blend or temp saves, and they now add a warning in window title: "(Recovered)"
- New Userpref option "Keep Session" - this always saves quit.blend, and loads on start.
This allows keeping UI and data without actual saves, until you actually save.
When you load startup.blend and quit, it recognises the quit.blend as a startup (no file name in header)
- Added 3D view copy/paste buffers (selected objects). Shortcuts ctrl-c, ctrl-v (OSX, cmd-c, cmd-v).
Coded partial file saving for it. Could be used for other purposes. Todo: use OS clipboards.
- User preferences (themes, keymaps, user settings) now can be saved as a separate file.
Old option is called "Save Startup File" the new one "Save User Settings".
To visualise this difference, the 'save startup file' button has been removed from user preferences window. That option is available as CTRL+U and in File menu still.
- OSX: fixed bug that stopped giving mouse events outside window.
This also fixes "Continuous Grab" for OSX. (error since 2009)
2012-12-12 18:58:11 +00:00
|
|
|
#define AZONEPAD_ICON (0.45f * U.widget_unit)
|
2009-09-12 23:56:30 +00:00
|
|
|
static void region_azone_edge(AZone *az, ARegion *ar)
|
2.5
First version of region-scaling. WIP commit, so bear with me a while!
- All fixed sized regions have a small 'drag' widget, on the left or top.
(not yet for free-sized regions, like 4-split).
- Mouse-over on widget changes cursor and allows drag.
- Click on widget hides/reveals.
- Fun for test; 3d view header, if high enough, draws more rows of
buttons when width is too small.
The WIP stuff;
- It doesn't save yet in files, using the "minsize" variable of region
definitions, also means other similar areas show same sizes now.
- Definitions for pref size, min/max will be added.
- Properties panel in Fcurve window draws widget on wrong place when
hidden (subdiv system needs tweak)
- Widgets don't draw perfect yet, also needs further tweaks.
But, in general it's quite fun and usable. :) Many variatians are possible,
like for real tabs, or little icons, or just click-drag on edge.
The reason to first try the widget/tab variation:
- it re-uses the "Area Action Zone" code, widgets for layouting Screens
- it's visible, hotkey-only options for screen layouts are not preferred.
- distinguish clearly area-edges from region-edges this way. Having the
cursor change shape on every edge (and block input) is probably annoying
too... but that can be tested.
Later more!
2009-05-24 13:29:29 +00:00
|
|
|
{
|
2012-04-28 06:31:57 +00:00
|
|
|
switch (az->edge) {
|
2010-09-20 13:13:40 +00:00
|
|
|
case AE_TOP_TO_BOTTOMRIGHT:
|
2012-05-08 15:43:59 +00:00
|
|
|
az->x1 = ar->winrct.xmin;
|
|
|
|
az->y1 = ar->winrct.ymax - AZONEPAD_EDGE;
|
|
|
|
az->x2 = ar->winrct.xmax;
|
2013-03-10 14:30:24 +00:00
|
|
|
az->y2 = ar->winrct.ymax + AZONEPAD_EDGE;
|
2010-09-20 13:13:40 +00:00
|
|
|
break;
|
|
|
|
case AE_BOTTOM_TO_TOPLEFT:
|
2012-05-08 15:43:59 +00:00
|
|
|
az->x1 = ar->winrct.xmin;
|
|
|
|
az->y1 = ar->winrct.ymin + AZONEPAD_EDGE;
|
|
|
|
az->x2 = ar->winrct.xmax;
|
2013-03-10 14:30:24 +00:00
|
|
|
az->y2 = ar->winrct.ymin - AZONEPAD_EDGE;
|
2010-09-20 13:13:40 +00:00
|
|
|
break;
|
|
|
|
case AE_LEFT_TO_TOPRIGHT:
|
2013-03-10 14:30:24 +00:00
|
|
|
az->x1 = ar->winrct.xmin - AZONEPAD_EDGE;
|
2012-05-08 15:43:59 +00:00
|
|
|
az->y1 = ar->winrct.ymin;
|
|
|
|
az->x2 = ar->winrct.xmin + AZONEPAD_EDGE;
|
|
|
|
az->y2 = ar->winrct.ymax;
|
2010-09-20 13:13:40 +00:00
|
|
|
break;
|
|
|
|
case AE_RIGHT_TO_TOPLEFT:
|
2013-03-10 14:30:24 +00:00
|
|
|
az->x1 = ar->winrct.xmax + AZONEPAD_EDGE;
|
2012-05-08 15:43:59 +00:00
|
|
|
az->y1 = ar->winrct.ymin;
|
|
|
|
az->x2 = ar->winrct.xmax - AZONEPAD_EDGE;
|
|
|
|
az->y2 = ar->winrct.ymax;
|
2010-09-20 13:13:40 +00:00
|
|
|
break;
|
2009-09-12 23:56:30 +00:00
|
|
|
}
|
|
|
|
|
2012-07-12 08:31:23 +00:00
|
|
|
BLI_rcti_init(&az->rect, az->x1, az->x2, az->y1, az->y2);
|
2009-09-12 23:56:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void region_azone_icon(ScrArea *sa, AZone *az, ARegion *ar)
|
|
|
|
{
|
|
|
|
AZone *azt;
|
2012-05-08 15:43:59 +00:00
|
|
|
int tot = 0;
|
2009-11-04 04:13:30 +00:00
|
|
|
|
2010-09-20 13:13:40 +00:00
|
|
|
/* count how many actionzones with along same edge are available.
|
2012-03-03 16:31:46 +00:00
|
|
|
* This allows for adding more action zones in the future without
|
|
|
|
* having to worry about correct offset */
|
2012-05-08 15:43:59 +00:00
|
|
|
for (azt = sa->actionzones.first; azt; azt = azt->next) {
|
2012-03-24 06:38:07 +00:00
|
|
|
if (azt->edge == az->edge) tot++;
|
2009-11-04 04:13:30 +00:00
|
|
|
}
|
2009-09-12 23:56:30 +00:00
|
|
|
|
2012-04-28 06:31:57 +00:00
|
|
|
switch (az->edge) {
|
2010-09-20 13:13:40 +00:00
|
|
|
case AE_TOP_TO_BOTTOMRIGHT:
|
2012-05-08 15:43:59 +00:00
|
|
|
az->x1 = ar->winrct.xmax - tot * 2 * AZONEPAD_ICON;
|
|
|
|
az->y1 = ar->winrct.ymax + AZONEPAD_ICON;
|
|
|
|
az->x2 = ar->winrct.xmax - tot * AZONEPAD_ICON;
|
|
|
|
az->y2 = ar->winrct.ymax + 2 * AZONEPAD_ICON;
|
2010-09-20 13:13:40 +00:00
|
|
|
break;
|
|
|
|
case AE_BOTTOM_TO_TOPLEFT:
|
2012-05-08 15:43:59 +00:00
|
|
|
az->x1 = ar->winrct.xmin + AZONEPAD_ICON;
|
|
|
|
az->y1 = ar->winrct.ymin - 2 * AZONEPAD_ICON;
|
|
|
|
az->x2 = ar->winrct.xmin + 2 * AZONEPAD_ICON;
|
|
|
|
az->y2 = ar->winrct.ymin - AZONEPAD_ICON;
|
2010-09-20 13:13:40 +00:00
|
|
|
break;
|
|
|
|
case AE_LEFT_TO_TOPRIGHT:
|
2012-05-08 15:43:59 +00:00
|
|
|
az->x1 = ar->winrct.xmin - 2 * AZONEPAD_ICON;
|
|
|
|
az->y1 = ar->winrct.ymax - tot * 2 * AZONEPAD_ICON;
|
|
|
|
az->x2 = ar->winrct.xmin - AZONEPAD_ICON;
|
|
|
|
az->y2 = ar->winrct.ymax - tot * AZONEPAD_ICON;
|
2010-09-20 13:13:40 +00:00
|
|
|
break;
|
|
|
|
case AE_RIGHT_TO_TOPLEFT:
|
2012-05-08 15:43:59 +00:00
|
|
|
az->x1 = ar->winrct.xmax + AZONEPAD_ICON;
|
|
|
|
az->y1 = ar->winrct.ymax - tot * 2 * AZONEPAD_ICON;
|
|
|
|
az->x2 = ar->winrct.xmax + 2 * AZONEPAD_ICON;
|
|
|
|
az->y2 = ar->winrct.ymax - tot * AZONEPAD_ICON;
|
2010-09-20 13:13:40 +00:00
|
|
|
break;
|
2009-09-12 23:56:30 +00:00
|
|
|
}
|
|
|
|
|
2012-07-12 08:31:23 +00:00
|
|
|
BLI_rcti_init(&az->rect, az->x1, az->x2, az->y1, az->y2);
|
2.5
First version of region-scaling. WIP commit, so bear with me a while!
- All fixed sized regions have a small 'drag' widget, on the left or top.
(not yet for free-sized regions, like 4-split).
- Mouse-over on widget changes cursor and allows drag.
- Click on widget hides/reveals.
- Fun for test; 3d view header, if high enough, draws more rows of
buttons when width is too small.
The WIP stuff;
- It doesn't save yet in files, using the "minsize" variable of region
definitions, also means other similar areas show same sizes now.
- Definitions for pref size, min/max will be added.
- Properties panel in Fcurve window draws widget on wrong place when
hidden (subdiv system needs tweak)
- Widgets don't draw perfect yet, also needs further tweaks.
But, in general it's quite fun and usable. :) Many variatians are possible,
like for real tabs, or little icons, or just click-drag on edge.
The reason to first try the widget/tab variation:
- it re-uses the "Area Action Zone" code, widgets for layouting Screens
- it's visible, hotkey-only options for screen layouts are not preferred.
- distinguish clearly area-edges from region-edges this way. Having the
cursor change shape on every edge (and block input) is probably annoying
too... but that can be tested.
Later more!
2009-05-24 13:29:29 +00:00
|
|
|
|
|
|
|
/* if more azones on 1 spot, set offset */
|
2012-05-08 15:43:59 +00:00
|
|
|
for (azt = sa->actionzones.first; azt; azt = azt->next) {
|
|
|
|
if (az != azt) {
|
|
|
|
if (ABS(az->x1 - azt->x1) < 2 && ABS(az->y1 - azt->y1) < 2) {
|
|
|
|
if (az->edge == AE_TOP_TO_BOTTOMRIGHT || az->edge == AE_BOTTOM_TO_TOPLEFT) {
|
|
|
|
az->x1 += AZONESPOT;
|
|
|
|
az->x2 += AZONESPOT;
|
2.5
First version of region-scaling. WIP commit, so bear with me a while!
- All fixed sized regions have a small 'drag' widget, on the left or top.
(not yet for free-sized regions, like 4-split).
- Mouse-over on widget changes cursor and allows drag.
- Click on widget hides/reveals.
- Fun for test; 3d view header, if high enough, draws more rows of
buttons when width is too small.
The WIP stuff;
- It doesn't save yet in files, using the "minsize" variable of region
definitions, also means other similar areas show same sizes now.
- Definitions for pref size, min/max will be added.
- Properties panel in Fcurve window draws widget on wrong place when
hidden (subdiv system needs tweak)
- Widgets don't draw perfect yet, also needs further tweaks.
But, in general it's quite fun and usable. :) Many variatians are possible,
like for real tabs, or little icons, or just click-drag on edge.
The reason to first try the widget/tab variation:
- it re-uses the "Area Action Zone" code, widgets for layouting Screens
- it's visible, hotkey-only options for screen layouts are not preferred.
- distinguish clearly area-edges from region-edges this way. Having the
cursor change shape on every edge (and block input) is probably annoying
too... but that can be tested.
Later more!
2009-05-24 13:29:29 +00:00
|
|
|
}
|
2012-03-24 06:38:07 +00:00
|
|
|
else {
|
2012-05-08 15:43:59 +00:00
|
|
|
az->y1 -= AZONESPOT;
|
|
|
|
az->y2 -= AZONESPOT;
|
2.5
First version of region-scaling. WIP commit, so bear with me a while!
- All fixed sized regions have a small 'drag' widget, on the left or top.
(not yet for free-sized regions, like 4-split).
- Mouse-over on widget changes cursor and allows drag.
- Click on widget hides/reveals.
- Fun for test; 3d view header, if high enough, draws more rows of
buttons when width is too small.
The WIP stuff;
- It doesn't save yet in files, using the "minsize" variable of region
definitions, also means other similar areas show same sizes now.
- Definitions for pref size, min/max will be added.
- Properties panel in Fcurve window draws widget on wrong place when
hidden (subdiv system needs tweak)
- Widgets don't draw perfect yet, also needs further tweaks.
But, in general it's quite fun and usable. :) Many variatians are possible,
like for real tabs, or little icons, or just click-drag on edge.
The reason to first try the widget/tab variation:
- it re-uses the "Area Action Zone" code, widgets for layouting Screens
- it's visible, hotkey-only options for screen layouts are not preferred.
- distinguish clearly area-edges from region-edges this way. Having the
cursor change shape on every edge (and block input) is probably annoying
too... but that can be tested.
Later more!
2009-05-24 13:29:29 +00:00
|
|
|
}
|
2012-07-12 08:31:23 +00:00
|
|
|
BLI_rcti_init(&az->rect, az->x1, az->x2, az->y1, az->y2);
|
2.5
First version of region-scaling. WIP commit, so bear with me a while!
- All fixed sized regions have a small 'drag' widget, on the left or top.
(not yet for free-sized regions, like 4-split).
- Mouse-over on widget changes cursor and allows drag.
- Click on widget hides/reveals.
- Fun for test; 3d view header, if high enough, draws more rows of
buttons when width is too small.
The WIP stuff;
- It doesn't save yet in files, using the "minsize" variable of region
definitions, also means other similar areas show same sizes now.
- Definitions for pref size, min/max will be added.
- Properties panel in Fcurve window draws widget on wrong place when
hidden (subdiv system needs tweak)
- Widgets don't draw perfect yet, also needs further tweaks.
But, in general it's quite fun and usable. :) Many variatians are possible,
like for real tabs, or little icons, or just click-drag on edge.
The reason to first try the widget/tab variation:
- it re-uses the "Area Action Zone" code, widgets for layouting Screens
- it's visible, hotkey-only options for screen layouts are not preferred.
- distinguish clearly area-edges from region-edges this way. Having the
cursor change shape on every edge (and block input) is probably annoying
too... but that can be tested.
Later more!
2009-05-24 13:29:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2009-09-12 23:56:30 +00:00
|
|
|
}
|
|
|
|
|
Holiday coding log :)
Nice formatted version (pictures soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.66/Usability
Short list of main changes:
- Transparent region option (over main region), added code to blend in/out such panels.
- Min size window now 640 x 480
- Fixed DPI for ui - lots of cleanup and changes everywhere. Icon image need correct size still, layer-in-use icon needs remake.
- Macbook retina support, use command line --no-native-pixels to disable it
- Timeline Marker label was drawing wrong
- Trackpad and magic mouse: supports zoom (hold ctrl)
- Fix for splash position: removed ghost function and made window size update after creation immediate
- Fast undo buffer save now adds UI as well. Could be checked for regular file save even...
Quit.blend and temp file saving use this now.
- Dixed filename in window on reading quit.blend or temp saves, and they now add a warning in window title: "(Recovered)"
- New Userpref option "Keep Session" - this always saves quit.blend, and loads on start.
This allows keeping UI and data without actual saves, until you actually save.
When you load startup.blend and quit, it recognises the quit.blend as a startup (no file name in header)
- Added 3D view copy/paste buffers (selected objects). Shortcuts ctrl-c, ctrl-v (OSX, cmd-c, cmd-v).
Coded partial file saving for it. Could be used for other purposes. Todo: use OS clipboards.
- User preferences (themes, keymaps, user settings) now can be saved as a separate file.
Old option is called "Save Startup File" the new one "Save User Settings".
To visualise this difference, the 'save startup file' button has been removed from user preferences window. That option is available as CTRL+U and in File menu still.
- OSX: fixed bug that stopped giving mouse events outside window.
This also fixes "Continuous Grab" for OSX. (error since 2009)
2012-12-12 18:58:11 +00:00
|
|
|
#define AZONEPAD_TAB_PLUSW (0.7f * U.widget_unit)
|
|
|
|
#define AZONEPAD_TAB_PLUSH (0.7f * U.widget_unit)
|
2011-11-19 22:05:18 +00:00
|
|
|
|
|
|
|
/* region already made zero sized, in shape of edge */
|
|
|
|
static void region_azone_tab_plus(ScrArea *sa, AZone *az, ARegion *ar)
|
|
|
|
{
|
|
|
|
AZone *azt;
|
2012-05-08 15:43:59 +00:00
|
|
|
int tot = 0, add;
|
2011-11-19 22:05:18 +00:00
|
|
|
|
2012-05-08 15:43:59 +00:00
|
|
|
for (azt = sa->actionzones.first; azt; azt = azt->next) {
|
2012-03-24 06:38:07 +00:00
|
|
|
if (azt->edge == az->edge) tot++;
|
2011-11-19 22:05:18 +00:00
|
|
|
}
|
|
|
|
|
2012-04-28 06:31:57 +00:00
|
|
|
switch (az->edge) {
|
2011-11-19 22:05:18 +00:00
|
|
|
case AE_TOP_TO_BOTTOMRIGHT:
|
2015-04-06 16:40:26 +10:00
|
|
|
add = (ar->winrct.ymax == sa->totrct.ymin) ? 1 : 0;
|
2012-12-13 00:47:47 +00:00
|
|
|
az->x1 = ar->winrct.xmax - 2.5f * AZONEPAD_TAB_PLUSW;
|
2012-05-08 15:43:59 +00:00
|
|
|
az->y1 = ar->winrct.ymax - add;
|
2012-12-13 00:47:47 +00:00
|
|
|
az->x2 = ar->winrct.xmax - 1.5f * AZONEPAD_TAB_PLUSW;
|
2012-05-08 15:43:59 +00:00
|
|
|
az->y2 = ar->winrct.ymax - add + AZONEPAD_TAB_PLUSH;
|
2011-11-19 22:05:18 +00:00
|
|
|
break;
|
|
|
|
case AE_BOTTOM_TO_TOPLEFT:
|
2012-12-13 00:47:47 +00:00
|
|
|
az->x1 = ar->winrct.xmax - 2.5f * AZONEPAD_TAB_PLUSW;
|
2012-05-08 15:43:59 +00:00
|
|
|
az->y1 = ar->winrct.ymin - AZONEPAD_TAB_PLUSH;
|
2012-12-13 00:47:47 +00:00
|
|
|
az->x2 = ar->winrct.xmax - 1.5f * AZONEPAD_TAB_PLUSW;
|
2012-05-08 15:43:59 +00:00
|
|
|
az->y2 = ar->winrct.ymin;
|
2011-11-19 22:05:18 +00:00
|
|
|
break;
|
|
|
|
case AE_LEFT_TO_TOPRIGHT:
|
2012-05-08 15:43:59 +00:00
|
|
|
az->x1 = ar->winrct.xmin - AZONEPAD_TAB_PLUSH;
|
2012-12-13 00:47:47 +00:00
|
|
|
az->y1 = ar->winrct.ymax - 2.5f * AZONEPAD_TAB_PLUSW;
|
2012-05-08 15:43:59 +00:00
|
|
|
az->x2 = ar->winrct.xmin;
|
2012-12-13 00:47:47 +00:00
|
|
|
az->y2 = ar->winrct.ymax - 1.5f * AZONEPAD_TAB_PLUSW;
|
2011-11-19 22:05:18 +00:00
|
|
|
break;
|
|
|
|
case AE_RIGHT_TO_TOPLEFT:
|
2012-05-08 15:43:59 +00:00
|
|
|
az->x1 = ar->winrct.xmax - 1;
|
2012-12-13 00:47:47 +00:00
|
|
|
az->y1 = ar->winrct.ymax - 2.5f * AZONEPAD_TAB_PLUSW;
|
2012-05-08 15:43:59 +00:00
|
|
|
az->x2 = ar->winrct.xmax - 1 + AZONEPAD_TAB_PLUSH;
|
2012-12-13 00:47:47 +00:00
|
|
|
az->y2 = ar->winrct.ymax - 1.5f * AZONEPAD_TAB_PLUSW;
|
2011-11-19 22:05:18 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
/* rect needed for mouse pointer test */
|
2012-07-12 08:31:23 +00:00
|
|
|
BLI_rcti_init(&az->rect, az->x1, az->x2, az->y1, az->y2);
|
2011-11-19 22:05:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
Holiday coding log :)
Nice formatted version (pictures soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.66/Usability
Short list of main changes:
- Transparent region option (over main region), added code to blend in/out such panels.
- Min size window now 640 x 480
- Fixed DPI for ui - lots of cleanup and changes everywhere. Icon image need correct size still, layer-in-use icon needs remake.
- Macbook retina support, use command line --no-native-pixels to disable it
- Timeline Marker label was drawing wrong
- Trackpad and magic mouse: supports zoom (hold ctrl)
- Fix for splash position: removed ghost function and made window size update after creation immediate
- Fast undo buffer save now adds UI as well. Could be checked for regular file save even...
Quit.blend and temp file saving use this now.
- Dixed filename in window on reading quit.blend or temp saves, and they now add a warning in window title: "(Recovered)"
- New Userpref option "Keep Session" - this always saves quit.blend, and loads on start.
This allows keeping UI and data without actual saves, until you actually save.
When you load startup.blend and quit, it recognises the quit.blend as a startup (no file name in header)
- Added 3D view copy/paste buffers (selected objects). Shortcuts ctrl-c, ctrl-v (OSX, cmd-c, cmd-v).
Coded partial file saving for it. Could be used for other purposes. Todo: use OS clipboards.
- User preferences (themes, keymaps, user settings) now can be saved as a separate file.
Old option is called "Save Startup File" the new one "Save User Settings".
To visualise this difference, the 'save startup file' button has been removed from user preferences window. That option is available as CTRL+U and in File menu still.
- OSX: fixed bug that stopped giving mouse events outside window.
This also fixes "Continuous Grab" for OSX. (error since 2009)
2012-12-12 18:58:11 +00:00
|
|
|
#define AZONEPAD_TABW (0.9f * U.widget_unit)
|
|
|
|
#define AZONEPAD_TABH (0.35f * U.widget_unit)
|
Todo item:
Closed regions didn't always draw the (+) icon right place, confusing
for users.
Next to that, I think this icon is using a bad metaphor or visual language,
Illustrated best if you close a header in outliner or buttons. Icons are
UI widgets, for screen/editor layouts different controls can be stylized.
My preference is something that aligns visually to the seperators between
regions; for testing and hacking pleasure I've added two quick versions,
a small tabbish thing and a triangle. Enable these with debug menu,
ALT+CTRL+D, values 1 or 2.
This is simply drawn with opengl now. An image for it can be made as well.
Previews:
http://www.blender.org/bf/closed_regions1.png
http://www.blender.org/bf/closed_regions2.png
http://www.blender.org/bf/closed_regions3.png
There's other design ideas to explore as well, like making region deviders
8-10 pixels wide, with a 'drag me' dot on it or so. That takes some screen
estate though, and will require to add big editor-dividers too...
Fun stuff for the mockup-mafia to check on, we have time :)
2011-06-30 15:02:03 +00:00
|
|
|
|
|
|
|
/* region already made zero sized, in shape of edge */
|
|
|
|
static void region_azone_tab(ScrArea *sa, AZone *az, ARegion *ar)
|
|
|
|
{
|
|
|
|
AZone *azt;
|
2012-05-08 15:43:59 +00:00
|
|
|
int tot = 0, add;
|
Todo item:
Closed regions didn't always draw the (+) icon right place, confusing
for users.
Next to that, I think this icon is using a bad metaphor or visual language,
Illustrated best if you close a header in outliner or buttons. Icons are
UI widgets, for screen/editor layouts different controls can be stylized.
My preference is something that aligns visually to the seperators between
regions; for testing and hacking pleasure I've added two quick versions,
a small tabbish thing and a triangle. Enable these with debug menu,
ALT+CTRL+D, values 1 or 2.
This is simply drawn with opengl now. An image for it can be made as well.
Previews:
http://www.blender.org/bf/closed_regions1.png
http://www.blender.org/bf/closed_regions2.png
http://www.blender.org/bf/closed_regions3.png
There's other design ideas to explore as well, like making region deviders
8-10 pixels wide, with a 'drag me' dot on it or so. That takes some screen
estate though, and will require to add big editor-dividers too...
Fun stuff for the mockup-mafia to check on, we have time :)
2011-06-30 15:02:03 +00:00
|
|
|
|
2012-05-08 15:43:59 +00:00
|
|
|
for (azt = sa->actionzones.first; azt; azt = azt->next) {
|
2012-03-24 06:38:07 +00:00
|
|
|
if (azt->edge == az->edge) tot++;
|
Todo item:
Closed regions didn't always draw the (+) icon right place, confusing
for users.
Next to that, I think this icon is using a bad metaphor or visual language,
Illustrated best if you close a header in outliner or buttons. Icons are
UI widgets, for screen/editor layouts different controls can be stylized.
My preference is something that aligns visually to the seperators between
regions; for testing and hacking pleasure I've added two quick versions,
a small tabbish thing and a triangle. Enable these with debug menu,
ALT+CTRL+D, values 1 or 2.
This is simply drawn with opengl now. An image for it can be made as well.
Previews:
http://www.blender.org/bf/closed_regions1.png
http://www.blender.org/bf/closed_regions2.png
http://www.blender.org/bf/closed_regions3.png
There's other design ideas to explore as well, like making region deviders
8-10 pixels wide, with a 'drag me' dot on it or so. That takes some screen
estate though, and will require to add big editor-dividers too...
Fun stuff for the mockup-mafia to check on, we have time :)
2011-06-30 15:02:03 +00:00
|
|
|
}
|
|
|
|
|
2012-04-28 06:31:57 +00:00
|
|
|
switch (az->edge) {
|
Todo item:
Closed regions didn't always draw the (+) icon right place, confusing
for users.
Next to that, I think this icon is using a bad metaphor or visual language,
Illustrated best if you close a header in outliner or buttons. Icons are
UI widgets, for screen/editor layouts different controls can be stylized.
My preference is something that aligns visually to the seperators between
regions; for testing and hacking pleasure I've added two quick versions,
a small tabbish thing and a triangle. Enable these with debug menu,
ALT+CTRL+D, values 1 or 2.
This is simply drawn with opengl now. An image for it can be made as well.
Previews:
http://www.blender.org/bf/closed_regions1.png
http://www.blender.org/bf/closed_regions2.png
http://www.blender.org/bf/closed_regions3.png
There's other design ideas to explore as well, like making region deviders
8-10 pixels wide, with a 'drag me' dot on it or so. That takes some screen
estate though, and will require to add big editor-dividers too...
Fun stuff for the mockup-mafia to check on, we have time :)
2011-06-30 15:02:03 +00:00
|
|
|
case AE_TOP_TO_BOTTOMRIGHT:
|
2015-04-06 16:40:26 +10:00
|
|
|
add = (ar->winrct.ymax == sa->totrct.ymin) ? 1 : 0;
|
2012-05-08 15:43:59 +00:00
|
|
|
az->x1 = ar->winrct.xmax - 2 * AZONEPAD_TABW;
|
|
|
|
az->y1 = ar->winrct.ymax - add;
|
|
|
|
az->x2 = ar->winrct.xmax - AZONEPAD_TABW;
|
|
|
|
az->y2 = ar->winrct.ymax - add + AZONEPAD_TABH;
|
Todo item:
Closed regions didn't always draw the (+) icon right place, confusing
for users.
Next to that, I think this icon is using a bad metaphor or visual language,
Illustrated best if you close a header in outliner or buttons. Icons are
UI widgets, for screen/editor layouts different controls can be stylized.
My preference is something that aligns visually to the seperators between
regions; for testing and hacking pleasure I've added two quick versions,
a small tabbish thing and a triangle. Enable these with debug menu,
ALT+CTRL+D, values 1 or 2.
This is simply drawn with opengl now. An image for it can be made as well.
Previews:
http://www.blender.org/bf/closed_regions1.png
http://www.blender.org/bf/closed_regions2.png
http://www.blender.org/bf/closed_regions3.png
There's other design ideas to explore as well, like making region deviders
8-10 pixels wide, with a 'drag me' dot on it or so. That takes some screen
estate though, and will require to add big editor-dividers too...
Fun stuff for the mockup-mafia to check on, we have time :)
2011-06-30 15:02:03 +00:00
|
|
|
break;
|
|
|
|
case AE_BOTTOM_TO_TOPLEFT:
|
2012-05-08 15:43:59 +00:00
|
|
|
az->x1 = ar->winrct.xmin + AZONEPAD_TABW;
|
|
|
|
az->y1 = ar->winrct.ymin - AZONEPAD_TABH;
|
|
|
|
az->x2 = ar->winrct.xmin + 2 * AZONEPAD_TABW;
|
|
|
|
az->y2 = ar->winrct.ymin;
|
Todo item:
Closed regions didn't always draw the (+) icon right place, confusing
for users.
Next to that, I think this icon is using a bad metaphor or visual language,
Illustrated best if you close a header in outliner or buttons. Icons are
UI widgets, for screen/editor layouts different controls can be stylized.
My preference is something that aligns visually to the seperators between
regions; for testing and hacking pleasure I've added two quick versions,
a small tabbish thing and a triangle. Enable these with debug menu,
ALT+CTRL+D, values 1 or 2.
This is simply drawn with opengl now. An image for it can be made as well.
Previews:
http://www.blender.org/bf/closed_regions1.png
http://www.blender.org/bf/closed_regions2.png
http://www.blender.org/bf/closed_regions3.png
There's other design ideas to explore as well, like making region deviders
8-10 pixels wide, with a 'drag me' dot on it or so. That takes some screen
estate though, and will require to add big editor-dividers too...
Fun stuff for the mockup-mafia to check on, we have time :)
2011-06-30 15:02:03 +00:00
|
|
|
break;
|
|
|
|
case AE_LEFT_TO_TOPRIGHT:
|
2012-05-08 15:43:59 +00:00
|
|
|
az->x1 = ar->winrct.xmin + 1 - AZONEPAD_TABH;
|
|
|
|
az->y1 = ar->winrct.ymax - 2 * AZONEPAD_TABW;
|
|
|
|
az->x2 = ar->winrct.xmin + 1;
|
|
|
|
az->y2 = ar->winrct.ymax - AZONEPAD_TABW;
|
Todo item:
Closed regions didn't always draw the (+) icon right place, confusing
for users.
Next to that, I think this icon is using a bad metaphor or visual language,
Illustrated best if you close a header in outliner or buttons. Icons are
UI widgets, for screen/editor layouts different controls can be stylized.
My preference is something that aligns visually to the seperators between
regions; for testing and hacking pleasure I've added two quick versions,
a small tabbish thing and a triangle. Enable these with debug menu,
ALT+CTRL+D, values 1 or 2.
This is simply drawn with opengl now. An image for it can be made as well.
Previews:
http://www.blender.org/bf/closed_regions1.png
http://www.blender.org/bf/closed_regions2.png
http://www.blender.org/bf/closed_regions3.png
There's other design ideas to explore as well, like making region deviders
8-10 pixels wide, with a 'drag me' dot on it or so. That takes some screen
estate though, and will require to add big editor-dividers too...
Fun stuff for the mockup-mafia to check on, we have time :)
2011-06-30 15:02:03 +00:00
|
|
|
break;
|
|
|
|
case AE_RIGHT_TO_TOPLEFT:
|
2012-05-08 15:43:59 +00:00
|
|
|
az->x1 = ar->winrct.xmax - 1;
|
|
|
|
az->y1 = ar->winrct.ymax - 2 * AZONEPAD_TABW;
|
|
|
|
az->x2 = ar->winrct.xmax - 1 + AZONEPAD_TABH;
|
|
|
|
az->y2 = ar->winrct.ymax - AZONEPAD_TABW;
|
Todo item:
Closed regions didn't always draw the (+) icon right place, confusing
for users.
Next to that, I think this icon is using a bad metaphor or visual language,
Illustrated best if you close a header in outliner or buttons. Icons are
UI widgets, for screen/editor layouts different controls can be stylized.
My preference is something that aligns visually to the seperators between
regions; for testing and hacking pleasure I've added two quick versions,
a small tabbish thing and a triangle. Enable these with debug menu,
ALT+CTRL+D, values 1 or 2.
This is simply drawn with opengl now. An image for it can be made as well.
Previews:
http://www.blender.org/bf/closed_regions1.png
http://www.blender.org/bf/closed_regions2.png
http://www.blender.org/bf/closed_regions3.png
There's other design ideas to explore as well, like making region deviders
8-10 pixels wide, with a 'drag me' dot on it or so. That takes some screen
estate though, and will require to add big editor-dividers too...
Fun stuff for the mockup-mafia to check on, we have time :)
2011-06-30 15:02:03 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
/* rect needed for mouse pointer test */
|
2012-07-12 08:31:23 +00:00
|
|
|
BLI_rcti_init(&az->rect, az->x1, az->x2, az->y1, az->y2);
|
Todo item:
Closed regions didn't always draw the (+) icon right place, confusing
for users.
Next to that, I think this icon is using a bad metaphor or visual language,
Illustrated best if you close a header in outliner or buttons. Icons are
UI widgets, for screen/editor layouts different controls can be stylized.
My preference is something that aligns visually to the seperators between
regions; for testing and hacking pleasure I've added two quick versions,
a small tabbish thing and a triangle. Enable these with debug menu,
ALT+CTRL+D, values 1 or 2.
This is simply drawn with opengl now. An image for it can be made as well.
Previews:
http://www.blender.org/bf/closed_regions1.png
http://www.blender.org/bf/closed_regions2.png
http://www.blender.org/bf/closed_regions3.png
There's other design ideas to explore as well, like making region deviders
8-10 pixels wide, with a 'drag me' dot on it or so. That takes some screen
estate though, and will require to add big editor-dividers too...
Fun stuff for the mockup-mafia to check on, we have time :)
2011-06-30 15:02:03 +00:00
|
|
|
}
|
|
|
|
|
Holiday coding log :)
Nice formatted version (pictures soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.66/Usability
Short list of main changes:
- Transparent region option (over main region), added code to blend in/out such panels.
- Min size window now 640 x 480
- Fixed DPI for ui - lots of cleanup and changes everywhere. Icon image need correct size still, layer-in-use icon needs remake.
- Macbook retina support, use command line --no-native-pixels to disable it
- Timeline Marker label was drawing wrong
- Trackpad and magic mouse: supports zoom (hold ctrl)
- Fix for splash position: removed ghost function and made window size update after creation immediate
- Fast undo buffer save now adds UI as well. Could be checked for regular file save even...
Quit.blend and temp file saving use this now.
- Dixed filename in window on reading quit.blend or temp saves, and they now add a warning in window title: "(Recovered)"
- New Userpref option "Keep Session" - this always saves quit.blend, and loads on start.
This allows keeping UI and data without actual saves, until you actually save.
When you load startup.blend and quit, it recognises the quit.blend as a startup (no file name in header)
- Added 3D view copy/paste buffers (selected objects). Shortcuts ctrl-c, ctrl-v (OSX, cmd-c, cmd-v).
Coded partial file saving for it. Could be used for other purposes. Todo: use OS clipboards.
- User preferences (themes, keymaps, user settings) now can be saved as a separate file.
Old option is called "Save Startup File" the new one "Save User Settings".
To visualise this difference, the 'save startup file' button has been removed from user preferences window. That option is available as CTRL+U and in File menu still.
- OSX: fixed bug that stopped giving mouse events outside window.
This also fixes "Continuous Grab" for OSX. (error since 2009)
2012-12-12 18:58:11 +00:00
|
|
|
#define AZONEPAD_TRIAW (0.8f * U.widget_unit)
|
|
|
|
#define AZONEPAD_TRIAH (0.45f * U.widget_unit)
|
Todo item:
Closed regions didn't always draw the (+) icon right place, confusing
for users.
Next to that, I think this icon is using a bad metaphor or visual language,
Illustrated best if you close a header in outliner or buttons. Icons are
UI widgets, for screen/editor layouts different controls can be stylized.
My preference is something that aligns visually to the seperators between
regions; for testing and hacking pleasure I've added two quick versions,
a small tabbish thing and a triangle. Enable these with debug menu,
ALT+CTRL+D, values 1 or 2.
This is simply drawn with opengl now. An image for it can be made as well.
Previews:
http://www.blender.org/bf/closed_regions1.png
http://www.blender.org/bf/closed_regions2.png
http://www.blender.org/bf/closed_regions3.png
There's other design ideas to explore as well, like making region deviders
8-10 pixels wide, with a 'drag me' dot on it or so. That takes some screen
estate though, and will require to add big editor-dividers too...
Fun stuff for the mockup-mafia to check on, we have time :)
2011-06-30 15:02:03 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* region already made zero sized, in shape of edge */
|
|
|
|
static void region_azone_tria(ScrArea *sa, AZone *az, ARegion *ar)
|
|
|
|
{
|
|
|
|
AZone *azt;
|
2012-05-08 15:43:59 +00:00
|
|
|
int tot = 0, add;
|
Todo item:
Closed regions didn't always draw the (+) icon right place, confusing
for users.
Next to that, I think this icon is using a bad metaphor or visual language,
Illustrated best if you close a header in outliner or buttons. Icons are
UI widgets, for screen/editor layouts different controls can be stylized.
My preference is something that aligns visually to the seperators between
regions; for testing and hacking pleasure I've added two quick versions,
a small tabbish thing and a triangle. Enable these with debug menu,
ALT+CTRL+D, values 1 or 2.
This is simply drawn with opengl now. An image for it can be made as well.
Previews:
http://www.blender.org/bf/closed_regions1.png
http://www.blender.org/bf/closed_regions2.png
http://www.blender.org/bf/closed_regions3.png
There's other design ideas to explore as well, like making region deviders
8-10 pixels wide, with a 'drag me' dot on it or so. That takes some screen
estate though, and will require to add big editor-dividers too...
Fun stuff for the mockup-mafia to check on, we have time :)
2011-06-30 15:02:03 +00:00
|
|
|
|
2012-05-08 15:43:59 +00:00
|
|
|
for (azt = sa->actionzones.first; azt; azt = azt->next) {
|
2012-03-24 06:38:07 +00:00
|
|
|
if (azt->edge == az->edge) tot++;
|
Todo item:
Closed regions didn't always draw the (+) icon right place, confusing
for users.
Next to that, I think this icon is using a bad metaphor or visual language,
Illustrated best if you close a header in outliner or buttons. Icons are
UI widgets, for screen/editor layouts different controls can be stylized.
My preference is something that aligns visually to the seperators between
regions; for testing and hacking pleasure I've added two quick versions,
a small tabbish thing and a triangle. Enable these with debug menu,
ALT+CTRL+D, values 1 or 2.
This is simply drawn with opengl now. An image for it can be made as well.
Previews:
http://www.blender.org/bf/closed_regions1.png
http://www.blender.org/bf/closed_regions2.png
http://www.blender.org/bf/closed_regions3.png
There's other design ideas to explore as well, like making region deviders
8-10 pixels wide, with a 'drag me' dot on it or so. That takes some screen
estate though, and will require to add big editor-dividers too...
Fun stuff for the mockup-mafia to check on, we have time :)
2011-06-30 15:02:03 +00:00
|
|
|
}
|
|
|
|
|
2012-04-28 06:31:57 +00:00
|
|
|
switch (az->edge) {
|
Todo item:
Closed regions didn't always draw the (+) icon right place, confusing
for users.
Next to that, I think this icon is using a bad metaphor or visual language,
Illustrated best if you close a header in outliner or buttons. Icons are
UI widgets, for screen/editor layouts different controls can be stylized.
My preference is something that aligns visually to the seperators between
regions; for testing and hacking pleasure I've added two quick versions,
a small tabbish thing and a triangle. Enable these with debug menu,
ALT+CTRL+D, values 1 or 2.
This is simply drawn with opengl now. An image for it can be made as well.
Previews:
http://www.blender.org/bf/closed_regions1.png
http://www.blender.org/bf/closed_regions2.png
http://www.blender.org/bf/closed_regions3.png
There's other design ideas to explore as well, like making region deviders
8-10 pixels wide, with a 'drag me' dot on it or so. That takes some screen
estate though, and will require to add big editor-dividers too...
Fun stuff for the mockup-mafia to check on, we have time :)
2011-06-30 15:02:03 +00:00
|
|
|
case AE_TOP_TO_BOTTOMRIGHT:
|
2015-04-06 16:40:26 +10:00
|
|
|
add = (ar->winrct.ymax == sa->totrct.ymin) ? 1 : 0;
|
2012-05-08 15:43:59 +00:00
|
|
|
az->x1 = ar->winrct.xmax - 2 * AZONEPAD_TRIAW;
|
|
|
|
az->y1 = ar->winrct.ymax - add;
|
|
|
|
az->x2 = ar->winrct.xmax - AZONEPAD_TRIAW;
|
|
|
|
az->y2 = ar->winrct.ymax - add + AZONEPAD_TRIAH;
|
Todo item:
Closed regions didn't always draw the (+) icon right place, confusing
for users.
Next to that, I think this icon is using a bad metaphor or visual language,
Illustrated best if you close a header in outliner or buttons. Icons are
UI widgets, for screen/editor layouts different controls can be stylized.
My preference is something that aligns visually to the seperators between
regions; for testing and hacking pleasure I've added two quick versions,
a small tabbish thing and a triangle. Enable these with debug menu,
ALT+CTRL+D, values 1 or 2.
This is simply drawn with opengl now. An image for it can be made as well.
Previews:
http://www.blender.org/bf/closed_regions1.png
http://www.blender.org/bf/closed_regions2.png
http://www.blender.org/bf/closed_regions3.png
There's other design ideas to explore as well, like making region deviders
8-10 pixels wide, with a 'drag me' dot on it or so. That takes some screen
estate though, and will require to add big editor-dividers too...
Fun stuff for the mockup-mafia to check on, we have time :)
2011-06-30 15:02:03 +00:00
|
|
|
break;
|
2012-05-08 15:43:59 +00:00
|
|
|
case AE_BOTTOM_TO_TOPLEFT:
|
|
|
|
az->x1 = ar->winrct.xmin + AZONEPAD_TRIAW;
|
|
|
|
az->y1 = ar->winrct.ymin - AZONEPAD_TRIAH;
|
|
|
|
az->x2 = ar->winrct.xmin + 2 * AZONEPAD_TRIAW;
|
|
|
|
az->y2 = ar->winrct.ymin;
|
Todo item:
Closed regions didn't always draw the (+) icon right place, confusing
for users.
Next to that, I think this icon is using a bad metaphor or visual language,
Illustrated best if you close a header in outliner or buttons. Icons are
UI widgets, for screen/editor layouts different controls can be stylized.
My preference is something that aligns visually to the seperators between
regions; for testing and hacking pleasure I've added two quick versions,
a small tabbish thing and a triangle. Enable these with debug menu,
ALT+CTRL+D, values 1 or 2.
This is simply drawn with opengl now. An image for it can be made as well.
Previews:
http://www.blender.org/bf/closed_regions1.png
http://www.blender.org/bf/closed_regions2.png
http://www.blender.org/bf/closed_regions3.png
There's other design ideas to explore as well, like making region deviders
8-10 pixels wide, with a 'drag me' dot on it or so. That takes some screen
estate though, and will require to add big editor-dividers too...
Fun stuff for the mockup-mafia to check on, we have time :)
2011-06-30 15:02:03 +00:00
|
|
|
break;
|
2012-05-08 15:43:59 +00:00
|
|
|
case AE_LEFT_TO_TOPRIGHT:
|
|
|
|
az->x1 = ar->winrct.xmin + 1 - AZONEPAD_TRIAH;
|
|
|
|
az->y1 = ar->winrct.ymax - 2 * AZONEPAD_TRIAW;
|
|
|
|
az->x2 = ar->winrct.xmin + 1;
|
|
|
|
az->y2 = ar->winrct.ymax - AZONEPAD_TRIAW;
|
Todo item:
Closed regions didn't always draw the (+) icon right place, confusing
for users.
Next to that, I think this icon is using a bad metaphor or visual language,
Illustrated best if you close a header in outliner or buttons. Icons are
UI widgets, for screen/editor layouts different controls can be stylized.
My preference is something that aligns visually to the seperators between
regions; for testing and hacking pleasure I've added two quick versions,
a small tabbish thing and a triangle. Enable these with debug menu,
ALT+CTRL+D, values 1 or 2.
This is simply drawn with opengl now. An image for it can be made as well.
Previews:
http://www.blender.org/bf/closed_regions1.png
http://www.blender.org/bf/closed_regions2.png
http://www.blender.org/bf/closed_regions3.png
There's other design ideas to explore as well, like making region deviders
8-10 pixels wide, with a 'drag me' dot on it or so. That takes some screen
estate though, and will require to add big editor-dividers too...
Fun stuff for the mockup-mafia to check on, we have time :)
2011-06-30 15:02:03 +00:00
|
|
|
break;
|
2012-05-08 15:43:59 +00:00
|
|
|
case AE_RIGHT_TO_TOPLEFT:
|
|
|
|
az->x1 = ar->winrct.xmax - 1;
|
|
|
|
az->y1 = ar->winrct.ymax - 2 * AZONEPAD_TRIAW;
|
|
|
|
az->x2 = ar->winrct.xmax - 1 + AZONEPAD_TRIAH;
|
|
|
|
az->y2 = ar->winrct.ymax - AZONEPAD_TRIAW;
|
Todo item:
Closed regions didn't always draw the (+) icon right place, confusing
for users.
Next to that, I think this icon is using a bad metaphor or visual language,
Illustrated best if you close a header in outliner or buttons. Icons are
UI widgets, for screen/editor layouts different controls can be stylized.
My preference is something that aligns visually to the seperators between
regions; for testing and hacking pleasure I've added two quick versions,
a small tabbish thing and a triangle. Enable these with debug menu,
ALT+CTRL+D, values 1 or 2.
This is simply drawn with opengl now. An image for it can be made as well.
Previews:
http://www.blender.org/bf/closed_regions1.png
http://www.blender.org/bf/closed_regions2.png
http://www.blender.org/bf/closed_regions3.png
There's other design ideas to explore as well, like making region deviders
8-10 pixels wide, with a 'drag me' dot on it or so. That takes some screen
estate though, and will require to add big editor-dividers too...
Fun stuff for the mockup-mafia to check on, we have time :)
2011-06-30 15:02:03 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
/* rect needed for mouse pointer test */
|
2012-07-12 08:31:23 +00:00
|
|
|
BLI_rcti_init(&az->rect, az->x1, az->x2, az->y1, az->y2);
|
Todo item:
Closed regions didn't always draw the (+) icon right place, confusing
for users.
Next to that, I think this icon is using a bad metaphor or visual language,
Illustrated best if you close a header in outliner or buttons. Icons are
UI widgets, for screen/editor layouts different controls can be stylized.
My preference is something that aligns visually to the seperators between
regions; for testing and hacking pleasure I've added two quick versions,
a small tabbish thing and a triangle. Enable these with debug menu,
ALT+CTRL+D, values 1 or 2.
This is simply drawn with opengl now. An image for it can be made as well.
Previews:
http://www.blender.org/bf/closed_regions1.png
http://www.blender.org/bf/closed_regions2.png
http://www.blender.org/bf/closed_regions3.png
There's other design ideas to explore as well, like making region deviders
8-10 pixels wide, with a 'drag me' dot on it or so. That takes some screen
estate though, and will require to add big editor-dividers too...
Fun stuff for the mockup-mafia to check on, we have time :)
2011-06-30 15:02:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-10-14 15:05:44 -03:00
|
|
|
static void region_azone_initialize(ScrArea *sa, ARegion *ar, AZEdge edge, const bool is_fullscreen)
|
2009-09-12 23:56:30 +00:00
|
|
|
{
|
2015-01-11 21:03:15 +01:00
|
|
|
AZone *az = NULL;
|
2014-10-14 15:05:44 -03:00
|
|
|
const bool is_hidden = (ar->flag & (RGN_FLAG_HIDDEN | RGN_FLAG_TOO_SMALL)) == 0;
|
2009-09-12 23:56:30 +00:00
|
|
|
|
2014-10-14 15:05:44 -03:00
|
|
|
if (is_hidden || !is_fullscreen) {
|
|
|
|
az = (AZone *)MEM_callocN(sizeof(AZone), "actionzone");
|
|
|
|
BLI_addtail(&(sa->actionzones), az);
|
|
|
|
az->type = AZONE_REGION;
|
|
|
|
az->ar = ar;
|
|
|
|
az->edge = edge;
|
|
|
|
}
|
2009-09-12 23:56:30 +00:00
|
|
|
|
2015-01-11 21:03:15 +01:00
|
|
|
if (!is_hidden) {
|
2014-10-14 15:05:44 -03:00
|
|
|
if (!is_fullscreen) {
|
|
|
|
if (G.debug_value == 3)
|
|
|
|
region_azone_icon(sa, az, ar);
|
|
|
|
else if (G.debug_value == 2)
|
|
|
|
region_azone_tria(sa, az, ar);
|
|
|
|
else if (G.debug_value == 1)
|
|
|
|
region_azone_tab(sa, az, ar);
|
|
|
|
else
|
|
|
|
region_azone_tab_plus(sa, az, ar);
|
|
|
|
}
|
2012-03-24 06:38:07 +00:00
|
|
|
}
|
|
|
|
else {
|
2009-09-12 23:56:30 +00:00
|
|
|
region_azone_edge(az, ar);
|
|
|
|
}
|
2.5
First version of region-scaling. WIP commit, so bear with me a while!
- All fixed sized regions have a small 'drag' widget, on the left or top.
(not yet for free-sized regions, like 4-split).
- Mouse-over on widget changes cursor and allows drag.
- Click on widget hides/reveals.
- Fun for test; 3d view header, if high enough, draws more rows of
buttons when width is too small.
The WIP stuff;
- It doesn't save yet in files, using the "minsize" variable of region
definitions, also means other similar areas show same sizes now.
- Definitions for pref size, min/max will be added.
- Properties panel in Fcurve window draws widget on wrong place when
hidden (subdiv system needs tweak)
- Widgets don't draw perfect yet, also needs further tweaks.
But, in general it's quite fun and usable. :) Many variatians are possible,
like for real tabs, or little icons, or just click-drag on edge.
The reason to first try the widget/tab variation:
- it re-uses the "Area Action Zone" code, widgets for layouting Screens
- it's visible, hotkey-only options for screen layouts are not preferred.
- distinguish clearly area-edges from region-edges this way. Having the
cursor change shape on every edge (and block input) is probably annoying
too... but that can be tested.
Later more!
2009-05-24 13:29:29 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-01-07 18:03:41 +00:00
|
|
|
/* *************************************************************** */
|
|
|
|
|
2014-10-14 15:05:44 -03:00
|
|
|
static void region_azone_add(ScrArea *sa, ARegion *ar, const int alignment, const bool is_fullscreen)
|
2.5
First version of region-scaling. WIP commit, so bear with me a while!
- All fixed sized regions have a small 'drag' widget, on the left or top.
(not yet for free-sized regions, like 4-split).
- Mouse-over on widget changes cursor and allows drag.
- Click on widget hides/reveals.
- Fun for test; 3d view header, if high enough, draws more rows of
buttons when width is too small.
The WIP stuff;
- It doesn't save yet in files, using the "minsize" variable of region
definitions, also means other similar areas show same sizes now.
- Definitions for pref size, min/max will be added.
- Properties panel in Fcurve window draws widget on wrong place when
hidden (subdiv system needs tweak)
- Widgets don't draw perfect yet, also needs further tweaks.
But, in general it's quite fun and usable. :) Many variatians are possible,
like for real tabs, or little icons, or just click-drag on edge.
The reason to first try the widget/tab variation:
- it re-uses the "Area Action Zone" code, widgets for layouting Screens
- it's visible, hotkey-only options for screen layouts are not preferred.
- distinguish clearly area-edges from region-edges this way. Having the
cursor change shape on every edge (and block input) is probably annoying
too... but that can be tested.
Later more!
2009-05-24 13:29:29 +00:00
|
|
|
{
|
2012-05-08 15:43:59 +00:00
|
|
|
/* edge code (t b l r) is along which area edge azone will be drawn */
|
2.5
First version of region-scaling. WIP commit, so bear with me a while!
- All fixed sized regions have a small 'drag' widget, on the left or top.
(not yet for free-sized regions, like 4-split).
- Mouse-over on widget changes cursor and allows drag.
- Click on widget hides/reveals.
- Fun for test; 3d view header, if high enough, draws more rows of
buttons when width is too small.
The WIP stuff;
- It doesn't save yet in files, using the "minsize" variable of region
definitions, also means other similar areas show same sizes now.
- Definitions for pref size, min/max will be added.
- Properties panel in Fcurve window draws widget on wrong place when
hidden (subdiv system needs tweak)
- Widgets don't draw perfect yet, also needs further tweaks.
But, in general it's quite fun and usable. :) Many variatians are possible,
like for real tabs, or little icons, or just click-drag on edge.
The reason to first try the widget/tab variation:
- it re-uses the "Area Action Zone" code, widgets for layouting Screens
- it's visible, hotkey-only options for screen layouts are not preferred.
- distinguish clearly area-edges from region-edges this way. Having the
cursor change shape on every edge (and block input) is probably annoying
too... but that can be tested.
Later more!
2009-05-24 13:29:29 +00:00
|
|
|
|
2012-05-08 15:43:59 +00:00
|
|
|
if (alignment == RGN_ALIGN_TOP)
|
2014-10-14 15:05:44 -03:00
|
|
|
region_azone_initialize(sa, ar, AE_BOTTOM_TO_TOPLEFT, is_fullscreen);
|
2012-05-08 15:43:59 +00:00
|
|
|
else if (alignment == RGN_ALIGN_BOTTOM)
|
2014-10-14 15:05:44 -03:00
|
|
|
region_azone_initialize(sa, ar, AE_TOP_TO_BOTTOMRIGHT, is_fullscreen);
|
Holiday coding log :)
Nice formatted version (pictures soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.66/Usability
Short list of main changes:
- Transparent region option (over main region), added code to blend in/out such panels.
- Min size window now 640 x 480
- Fixed DPI for ui - lots of cleanup and changes everywhere. Icon image need correct size still, layer-in-use icon needs remake.
- Macbook retina support, use command line --no-native-pixels to disable it
- Timeline Marker label was drawing wrong
- Trackpad and magic mouse: supports zoom (hold ctrl)
- Fix for splash position: removed ghost function and made window size update after creation immediate
- Fast undo buffer save now adds UI as well. Could be checked for regular file save even...
Quit.blend and temp file saving use this now.
- Dixed filename in window on reading quit.blend or temp saves, and they now add a warning in window title: "(Recovered)"
- New Userpref option "Keep Session" - this always saves quit.blend, and loads on start.
This allows keeping UI and data without actual saves, until you actually save.
When you load startup.blend and quit, it recognises the quit.blend as a startup (no file name in header)
- Added 3D view copy/paste buffers (selected objects). Shortcuts ctrl-c, ctrl-v (OSX, cmd-c, cmd-v).
Coded partial file saving for it. Could be used for other purposes. Todo: use OS clipboards.
- User preferences (themes, keymaps, user settings) now can be saved as a separate file.
Old option is called "Save Startup File" the new one "Save User Settings".
To visualise this difference, the 'save startup file' button has been removed from user preferences window. That option is available as CTRL+U and in File menu still.
- OSX: fixed bug that stopped giving mouse events outside window.
This also fixes "Continuous Grab" for OSX. (error since 2009)
2012-12-12 18:58:11 +00:00
|
|
|
else if (alignment == RGN_ALIGN_RIGHT)
|
2014-10-14 15:05:44 -03:00
|
|
|
region_azone_initialize(sa, ar, AE_LEFT_TO_TOPRIGHT, is_fullscreen);
|
Holiday coding log :)
Nice formatted version (pictures soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.66/Usability
Short list of main changes:
- Transparent region option (over main region), added code to blend in/out such panels.
- Min size window now 640 x 480
- Fixed DPI for ui - lots of cleanup and changes everywhere. Icon image need correct size still, layer-in-use icon needs remake.
- Macbook retina support, use command line --no-native-pixels to disable it
- Timeline Marker label was drawing wrong
- Trackpad and magic mouse: supports zoom (hold ctrl)
- Fix for splash position: removed ghost function and made window size update after creation immediate
- Fast undo buffer save now adds UI as well. Could be checked for regular file save even...
Quit.blend and temp file saving use this now.
- Dixed filename in window on reading quit.blend or temp saves, and they now add a warning in window title: "(Recovered)"
- New Userpref option "Keep Session" - this always saves quit.blend, and loads on start.
This allows keeping UI and data without actual saves, until you actually save.
When you load startup.blend and quit, it recognises the quit.blend as a startup (no file name in header)
- Added 3D view copy/paste buffers (selected objects). Shortcuts ctrl-c, ctrl-v (OSX, cmd-c, cmd-v).
Coded partial file saving for it. Could be used for other purposes. Todo: use OS clipboards.
- User preferences (themes, keymaps, user settings) now can be saved as a separate file.
Old option is called "Save Startup File" the new one "Save User Settings".
To visualise this difference, the 'save startup file' button has been removed from user preferences window. That option is available as CTRL+U and in File menu still.
- OSX: fixed bug that stopped giving mouse events outside window.
This also fixes "Continuous Grab" for OSX. (error since 2009)
2012-12-12 18:58:11 +00:00
|
|
|
else if (alignment == RGN_ALIGN_LEFT)
|
2014-10-14 15:05:44 -03:00
|
|
|
region_azone_initialize(sa, ar, AE_RIGHT_TO_TOPLEFT, is_fullscreen);
|
2.5
First version of region-scaling. WIP commit, so bear with me a while!
- All fixed sized regions have a small 'drag' widget, on the left or top.
(not yet for free-sized regions, like 4-split).
- Mouse-over on widget changes cursor and allows drag.
- Click on widget hides/reveals.
- Fun for test; 3d view header, if high enough, draws more rows of
buttons when width is too small.
The WIP stuff;
- It doesn't save yet in files, using the "minsize" variable of region
definitions, also means other similar areas show same sizes now.
- Definitions for pref size, min/max will be added.
- Properties panel in Fcurve window draws widget on wrong place when
hidden (subdiv system needs tweak)
- Widgets don't draw perfect yet, also needs further tweaks.
But, in general it's quite fun and usable. :) Many variatians are possible,
like for real tabs, or little icons, or just click-drag on edge.
The reason to first try the widget/tab variation:
- it re-uses the "Area Action Zone" code, widgets for layouting Screens
- it's visible, hotkey-only options for screen layouts are not preferred.
- distinguish clearly area-edges from region-edges this way. Having the
cursor change shape on every edge (and block input) is probably annoying
too... but that can be tested.
Later more!
2009-05-24 13:29:29 +00:00
|
|
|
}
|
|
|
|
|
2008-12-09 15:59:43 +00:00
|
|
|
/* dir is direction to check, not the splitting edge direction! */
|
2015-06-30 15:31:55 +10:00
|
|
|
static int rct_fits(const rcti *rect, char dir, int size)
|
2008-01-07 18:03:41 +00:00
|
|
|
{
|
2012-05-08 15:43:59 +00:00
|
|
|
if (dir == 'h') {
|
2013-11-25 13:40:58 +01:00
|
|
|
return BLI_rcti_size_x(rect) + 1 - size;
|
2008-01-07 18:03:41 +00:00
|
|
|
}
|
2012-08-20 23:06:17 +00:00
|
|
|
else { /* 'v' */
|
2013-11-25 13:40:58 +01:00
|
|
|
return BLI_rcti_size_y(rect) + 1 - size;
|
2008-01-07 18:03:41 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Holiday coding log :)
Nice formatted version (pictures soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.66/Usability
Short list of main changes:
- Transparent region option (over main region), added code to blend in/out such panels.
- Min size window now 640 x 480
- Fixed DPI for ui - lots of cleanup and changes everywhere. Icon image need correct size still, layer-in-use icon needs remake.
- Macbook retina support, use command line --no-native-pixels to disable it
- Timeline Marker label was drawing wrong
- Trackpad and magic mouse: supports zoom (hold ctrl)
- Fix for splash position: removed ghost function and made window size update after creation immediate
- Fast undo buffer save now adds UI as well. Could be checked for regular file save even...
Quit.blend and temp file saving use this now.
- Dixed filename in window on reading quit.blend or temp saves, and they now add a warning in window title: "(Recovered)"
- New Userpref option "Keep Session" - this always saves quit.blend, and loads on start.
This allows keeping UI and data without actual saves, until you actually save.
When you load startup.blend and quit, it recognises the quit.blend as a startup (no file name in header)
- Added 3D view copy/paste buffers (selected objects). Shortcuts ctrl-c, ctrl-v (OSX, cmd-c, cmd-v).
Coded partial file saving for it. Could be used for other purposes. Todo: use OS clipboards.
- User preferences (themes, keymaps, user settings) now can be saved as a separate file.
Old option is called "Save Startup File" the new one "Save User Settings".
To visualise this difference, the 'save startup file' button has been removed from user preferences window. That option is available as CTRL+U and in File menu still.
- OSX: fixed bug that stopped giving mouse events outside window.
This also fixes "Continuous Grab" for OSX. (error since 2009)
2012-12-12 18:58:11 +00:00
|
|
|
/* *************************************************************** */
|
|
|
|
|
2012-12-13 17:43:12 +00:00
|
|
|
/* ar should be overlapping */
|
|
|
|
/* function checks if some overlapping region was defined before - on same place */
|
2012-12-19 16:16:20 +00:00
|
|
|
static void region_overlap_fix(ScrArea *sa, ARegion *ar)
|
2012-12-13 17:43:12 +00:00
|
|
|
{
|
2014-08-15 15:36:25 +02:00
|
|
|
ARegion *ar1;
|
|
|
|
const int align = ar->alignment & ~RGN_SPLIT_PREV;
|
|
|
|
int align1 = 0;
|
|
|
|
|
2012-12-13 17:43:12 +00:00
|
|
|
/* find overlapping previous region on same place */
|
2014-08-15 15:36:25 +02:00
|
|
|
for (ar1 = ar->prev; ar1; ar1 = ar1->prev) {
|
|
|
|
if (ar1->overlap && ((ar1->alignment & RGN_SPLIT_PREV) == 0)) {
|
|
|
|
align1 = ar1->alignment;
|
|
|
|
if (BLI_rcti_isect(&ar1->winrct, &ar->winrct, NULL)) {
|
|
|
|
if (align1 != align) {
|
|
|
|
/* Left overlapping right or vice-versa, forbid this! */
|
|
|
|
ar->flag |= RGN_FLAG_TOO_SMALL;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
/* Else, we have our previous region on same side. */
|
|
|
|
break;
|
|
|
|
}
|
2012-12-13 17:43:12 +00:00
|
|
|
}
|
|
|
|
}
|
2014-08-15 15:36:25 +02:00
|
|
|
|
2012-12-19 16:16:20 +00:00
|
|
|
/* translate or close */
|
2012-12-13 17:43:12 +00:00
|
|
|
if (ar1) {
|
|
|
|
if (align1 == RGN_ALIGN_LEFT) {
|
2014-08-15 15:36:25 +02:00
|
|
|
if (ar->winrct.xmax + ar1->winx > sa->winx - U.widget_unit) {
|
2012-12-19 16:16:20 +00:00
|
|
|
ar->flag |= RGN_FLAG_TOO_SMALL;
|
2014-08-15 15:36:25 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
else {
|
2012-12-19 16:16:20 +00:00
|
|
|
BLI_rcti_translate(&ar->winrct, ar1->winx, 0);
|
2014-08-15 15:36:25 +02:00
|
|
|
}
|
2012-12-13 17:43:12 +00:00
|
|
|
}
|
|
|
|
else if (align1 == RGN_ALIGN_RIGHT) {
|
2014-08-15 15:36:25 +02:00
|
|
|
if (ar->winrct.xmin - ar1->winx < U.widget_unit) {
|
2012-12-19 16:16:20 +00:00
|
|
|
ar->flag |= RGN_FLAG_TOO_SMALL;
|
2014-08-15 15:36:25 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
else {
|
2012-12-19 16:16:20 +00:00
|
|
|
BLI_rcti_translate(&ar->winrct, -ar1->winx, 0);
|
2014-08-15 15:36:25 +02:00
|
|
|
}
|
2012-12-13 17:43:12 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-08-15 15:36:25 +02:00
|
|
|
/* At this point, 'ar' is in its final position and still open.
|
|
|
|
* Make a final check it does not overlap any previous 'other side' region. */
|
|
|
|
for (ar1 = ar->prev; ar1; ar1 = ar1->prev) {
|
|
|
|
if (ar1->overlap && (ar1->alignment & RGN_SPLIT_PREV) == 0) {
|
|
|
|
if ((ar1->alignment != align) && BLI_rcti_isect(&ar1->winrct, &ar->winrct, NULL)) {
|
|
|
|
/* Left overlapping right or vice-versa, forbid this! */
|
|
|
|
ar->flag |= RGN_FLAG_TOO_SMALL;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2012-12-13 17:43:12 +00:00
|
|
|
}
|
|
|
|
|
Holiday coding log :)
Nice formatted version (pictures soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.66/Usability
Short list of main changes:
- Transparent region option (over main region), added code to blend in/out such panels.
- Min size window now 640 x 480
- Fixed DPI for ui - lots of cleanup and changes everywhere. Icon image need correct size still, layer-in-use icon needs remake.
- Macbook retina support, use command line --no-native-pixels to disable it
- Timeline Marker label was drawing wrong
- Trackpad and magic mouse: supports zoom (hold ctrl)
- Fix for splash position: removed ghost function and made window size update after creation immediate
- Fast undo buffer save now adds UI as well. Could be checked for regular file save even...
Quit.blend and temp file saving use this now.
- Dixed filename in window on reading quit.blend or temp saves, and they now add a warning in window title: "(Recovered)"
- New Userpref option "Keep Session" - this always saves quit.blend, and loads on start.
This allows keeping UI and data without actual saves, until you actually save.
When you load startup.blend and quit, it recognises the quit.blend as a startup (no file name in header)
- Added 3D view copy/paste buffers (selected objects). Shortcuts ctrl-c, ctrl-v (OSX, cmd-c, cmd-v).
Coded partial file saving for it. Could be used for other purposes. Todo: use OS clipboards.
- User preferences (themes, keymaps, user settings) now can be saved as a separate file.
Old option is called "Save Startup File" the new one "Save User Settings".
To visualise this difference, the 'save startup file' button has been removed from user preferences window. That option is available as CTRL+U and in File menu still.
- OSX: fixed bug that stopped giving mouse events outside window.
This also fixes "Continuous Grab" for OSX. (error since 2009)
2012-12-12 18:58:11 +00:00
|
|
|
/* overlapping regions only in the following restricted cases */
|
2014-02-05 22:36:15 +11:00
|
|
|
static bool region_is_overlap(wmWindow *win, ScrArea *sa, ARegion *ar)
|
Holiday coding log :)
Nice formatted version (pictures soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.66/Usability
Short list of main changes:
- Transparent region option (over main region), added code to blend in/out such panels.
- Min size window now 640 x 480
- Fixed DPI for ui - lots of cleanup and changes everywhere. Icon image need correct size still, layer-in-use icon needs remake.
- Macbook retina support, use command line --no-native-pixels to disable it
- Timeline Marker label was drawing wrong
- Trackpad and magic mouse: supports zoom (hold ctrl)
- Fix for splash position: removed ghost function and made window size update after creation immediate
- Fast undo buffer save now adds UI as well. Could be checked for regular file save even...
Quit.blend and temp file saving use this now.
- Dixed filename in window on reading quit.blend or temp saves, and they now add a warning in window title: "(Recovered)"
- New Userpref option "Keep Session" - this always saves quit.blend, and loads on start.
This allows keeping UI and data without actual saves, until you actually save.
When you load startup.blend and quit, it recognises the quit.blend as a startup (no file name in header)
- Added 3D view copy/paste buffers (selected objects). Shortcuts ctrl-c, ctrl-v (OSX, cmd-c, cmd-v).
Coded partial file saving for it. Could be used for other purposes. Todo: use OS clipboards.
- User preferences (themes, keymaps, user settings) now can be saved as a separate file.
Old option is called "Save Startup File" the new one "Save User Settings".
To visualise this difference, the 'save startup file' button has been removed from user preferences window. That option is available as CTRL+U and in File menu still.
- OSX: fixed bug that stopped giving mouse events outside window.
This also fixes "Continuous Grab" for OSX. (error since 2009)
2012-12-12 18:58:11 +00:00
|
|
|
{
|
2013-07-08 18:27:32 +00:00
|
|
|
if (U.uiflag2 & USER_REGION_OVERLAP) {
|
|
|
|
if (WM_is_draw_triple(win)) {
|
|
|
|
if (ELEM(sa->spacetype, SPACE_VIEW3D, SPACE_SEQ)) {
|
2014-07-20 01:30:29 +10:00
|
|
|
if (ELEM(ar->regiontype, RGN_TYPE_TOOLS, RGN_TYPE_UI, RGN_TYPE_TOOL_PROPS))
|
Holiday coding log :)
Nice formatted version (pictures soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.66/Usability
Short list of main changes:
- Transparent region option (over main region), added code to blend in/out such panels.
- Min size window now 640 x 480
- Fixed DPI for ui - lots of cleanup and changes everywhere. Icon image need correct size still, layer-in-use icon needs remake.
- Macbook retina support, use command line --no-native-pixels to disable it
- Timeline Marker label was drawing wrong
- Trackpad and magic mouse: supports zoom (hold ctrl)
- Fix for splash position: removed ghost function and made window size update after creation immediate
- Fast undo buffer save now adds UI as well. Could be checked for regular file save even...
Quit.blend and temp file saving use this now.
- Dixed filename in window on reading quit.blend or temp saves, and they now add a warning in window title: "(Recovered)"
- New Userpref option "Keep Session" - this always saves quit.blend, and loads on start.
This allows keeping UI and data without actual saves, until you actually save.
When you load startup.blend and quit, it recognises the quit.blend as a startup (no file name in header)
- Added 3D view copy/paste buffers (selected objects). Shortcuts ctrl-c, ctrl-v (OSX, cmd-c, cmd-v).
Coded partial file saving for it. Could be used for other purposes. Todo: use OS clipboards.
- User preferences (themes, keymaps, user settings) now can be saved as a separate file.
Old option is called "Save Startup File" the new one "Save User Settings".
To visualise this difference, the 'save startup file' button has been removed from user preferences window. That option is available as CTRL+U and in File menu still.
- OSX: fixed bug that stopped giving mouse events outside window.
This also fixes "Continuous Grab" for OSX. (error since 2009)
2012-12-12 18:58:11 +00:00
|
|
|
return 1;
|
2013-07-08 18:27:32 +00:00
|
|
|
}
|
2013-12-16 17:16:05 +06:00
|
|
|
else if (sa->spacetype == SPACE_IMAGE) {
|
2014-07-20 01:30:29 +10:00
|
|
|
if (ELEM(ar->regiontype, RGN_TYPE_TOOLS, RGN_TYPE_UI, RGN_TYPE_TOOL_PROPS, RGN_TYPE_PREVIEW))
|
2013-07-08 18:27:32 +00:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Holiday coding log :)
Nice formatted version (pictures soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.66/Usability
Short list of main changes:
- Transparent region option (over main region), added code to blend in/out such panels.
- Min size window now 640 x 480
- Fixed DPI for ui - lots of cleanup and changes everywhere. Icon image need correct size still, layer-in-use icon needs remake.
- Macbook retina support, use command line --no-native-pixels to disable it
- Timeline Marker label was drawing wrong
- Trackpad and magic mouse: supports zoom (hold ctrl)
- Fix for splash position: removed ghost function and made window size update after creation immediate
- Fast undo buffer save now adds UI as well. Could be checked for regular file save even...
Quit.blend and temp file saving use this now.
- Dixed filename in window on reading quit.blend or temp saves, and they now add a warning in window title: "(Recovered)"
- New Userpref option "Keep Session" - this always saves quit.blend, and loads on start.
This allows keeping UI and data without actual saves, until you actually save.
When you load startup.blend and quit, it recognises the quit.blend as a startup (no file name in header)
- Added 3D view copy/paste buffers (selected objects). Shortcuts ctrl-c, ctrl-v (OSX, cmd-c, cmd-v).
Coded partial file saving for it. Could be used for other purposes. Todo: use OS clipboards.
- User preferences (themes, keymaps, user settings) now can be saved as a separate file.
Old option is called "Save Startup File" the new one "Save User Settings".
To visualise this difference, the 'save startup file' button has been removed from user preferences window. That option is available as CTRL+U and in File menu still.
- OSX: fixed bug that stopped giving mouse events outside window.
This also fixes "Continuous Grab" for OSX. (error since 2009)
2012-12-12 18:58:11 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void region_rect_recursive(wmWindow *win, ScrArea *sa, ARegion *ar, rcti *remainder, int quad)
|
2008-01-07 18:03:41 +00:00
|
|
|
{
|
2012-05-08 15:43:59 +00:00
|
|
|
rcti *remainder_prev = remainder;
|
2008-12-10 13:56:54 +00:00
|
|
|
int prefsizex, prefsizey;
|
2009-02-20 19:11:35 +00:00
|
|
|
int alignment;
|
2008-12-10 13:56:54 +00:00
|
|
|
|
2012-05-08 15:43:59 +00:00
|
|
|
if (ar == NULL)
|
2008-01-07 18:03:41 +00:00
|
|
|
return;
|
|
|
|
|
2.5
First version of region-scaling. WIP commit, so bear with me a while!
- All fixed sized regions have a small 'drag' widget, on the left or top.
(not yet for free-sized regions, like 4-split).
- Mouse-over on widget changes cursor and allows drag.
- Click on widget hides/reveals.
- Fun for test; 3d view header, if high enough, draws more rows of
buttons when width is too small.
The WIP stuff;
- It doesn't save yet in files, using the "minsize" variable of region
definitions, also means other similar areas show same sizes now.
- Definitions for pref size, min/max will be added.
- Properties panel in Fcurve window draws widget on wrong place when
hidden (subdiv system needs tweak)
- Widgets don't draw perfect yet, also needs further tweaks.
But, in general it's quite fun and usable. :) Many variatians are possible,
like for real tabs, or little icons, or just click-drag on edge.
The reason to first try the widget/tab variation:
- it re-uses the "Area Action Zone" code, widgets for layouting Screens
- it's visible, hotkey-only options for screen layouts are not preferred.
- distinguish clearly area-edges from region-edges this way. Having the
cursor change shape on every edge (and block input) is probably annoying
too... but that can be tested.
Later more!
2009-05-24 13:29:29 +00:00
|
|
|
/* no returns in function, winrct gets set in the end again */
|
2012-07-12 08:31:23 +00:00
|
|
|
BLI_rcti_init(&ar->winrct, 0, 0, 0, 0);
|
2009-02-17 15:53:52 +00:00
|
|
|
|
2009-02-20 19:11:35 +00:00
|
|
|
/* for test; allow split of previously defined region */
|
2012-03-24 06:38:07 +00:00
|
|
|
if (ar->alignment & RGN_SPLIT_PREV)
|
|
|
|
if (ar->prev)
|
2012-05-08 15:43:59 +00:00
|
|
|
remainder = &ar->prev->winrct;
|
2009-02-20 19:11:35 +00:00
|
|
|
|
|
|
|
alignment = ar->alignment & ~RGN_SPLIT_PREV;
|
|
|
|
|
Holiday coding log :)
Nice formatted version (pictures soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.66/Usability
Short list of main changes:
- Transparent region option (over main region), added code to blend in/out such panels.
- Min size window now 640 x 480
- Fixed DPI for ui - lots of cleanup and changes everywhere. Icon image need correct size still, layer-in-use icon needs remake.
- Macbook retina support, use command line --no-native-pixels to disable it
- Timeline Marker label was drawing wrong
- Trackpad and magic mouse: supports zoom (hold ctrl)
- Fix for splash position: removed ghost function and made window size update after creation immediate
- Fast undo buffer save now adds UI as well. Could be checked for regular file save even...
Quit.blend and temp file saving use this now.
- Dixed filename in window on reading quit.blend or temp saves, and they now add a warning in window title: "(Recovered)"
- New Userpref option "Keep Session" - this always saves quit.blend, and loads on start.
This allows keeping UI and data without actual saves, until you actually save.
When you load startup.blend and quit, it recognises the quit.blend as a startup (no file name in header)
- Added 3D view copy/paste buffers (selected objects). Shortcuts ctrl-c, ctrl-v (OSX, cmd-c, cmd-v).
Coded partial file saving for it. Could be used for other purposes. Todo: use OS clipboards.
- User preferences (themes, keymaps, user settings) now can be saved as a separate file.
Old option is called "Save Startup File" the new one "Save User Settings".
To visualise this difference, the 'save startup file' button has been removed from user preferences window. That option is available as CTRL+U and in File menu still.
- OSX: fixed bug that stopped giving mouse events outside window.
This also fixes "Continuous Grab" for OSX. (error since 2009)
2012-12-12 18:58:11 +00:00
|
|
|
/* set here, assuming userpref switching forces to call this again */
|
|
|
|
ar->overlap = region_is_overlap(win, sa, ar);
|
|
|
|
|
2008-12-09 15:59:43 +00:00
|
|
|
/* clear state flags first */
|
2008-01-07 18:03:41 +00:00
|
|
|
ar->flag &= ~RGN_FLAG_TOO_SMALL;
|
2.5
View3D has been split now in a local part (RegionView3D) and a
per-area part (old View3D). Currently local is:
- view transform
- camera zoom/offset
- gpencil (todo)
- custom clipping planes
Rest is in Area still, like active camera, draw type, layers,
localview, custom centers, around-settings, transform widget,
gridlines, and so on (mostly stuff as available in header).
To see it work; also added new feature for region split,
press SHIFT+ALT+CTRL+S for four-split.
The idea is to make a preset 4-split, configured to stick
to top/right/front views for three views.
Another cool idea to explore is to then box-clip all drawing
based on these 3 views.
Note about the code:
- currently view3d still stores some depricated settings, to
convert from older files. Not all settings are copied over
though, like custom clip planes or the 'lock view to object'.
- since some view3d ops are now on area level, the operators
for it should keep track of that.
Bugfix in transform: quat initialize in operator-invoke missed
one zero.
Als brought back GE to compile for missing Ipos and channels.
2009-01-19 16:54:41 +00:00
|
|
|
/* user errors */
|
2012-05-08 15:43:59 +00:00
|
|
|
if (ar->next == NULL && alignment != RGN_ALIGN_QSPLIT)
|
|
|
|
alignment = RGN_ALIGN_NONE;
|
2008-01-07 18:03:41 +00:00
|
|
|
|
2012-12-19 15:44:47 +00:00
|
|
|
/* prefsize, for header we stick to exception (prevent dpi rounding error) */
|
|
|
|
prefsizex = UI_DPI_FAC * (ar->sizex > 1 ? ar->sizex + 0.5f : ar->type->prefsizex);
|
|
|
|
|
2012-10-07 09:48:59 +00:00
|
|
|
if (ar->regiontype == RGN_TYPE_HEADER) {
|
Holiday coding log :)
Nice formatted version (pictures soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.66/Usability
Short list of main changes:
- Transparent region option (over main region), added code to blend in/out such panels.
- Min size window now 640 x 480
- Fixed DPI for ui - lots of cleanup and changes everywhere. Icon image need correct size still, layer-in-use icon needs remake.
- Macbook retina support, use command line --no-native-pixels to disable it
- Timeline Marker label was drawing wrong
- Trackpad and magic mouse: supports zoom (hold ctrl)
- Fix for splash position: removed ghost function and made window size update after creation immediate
- Fast undo buffer save now adds UI as well. Could be checked for regular file save even...
Quit.blend and temp file saving use this now.
- Dixed filename in window on reading quit.blend or temp saves, and they now add a warning in window title: "(Recovered)"
- New Userpref option "Keep Session" - this always saves quit.blend, and loads on start.
This allows keeping UI and data without actual saves, until you actually save.
When you load startup.blend and quit, it recognises the quit.blend as a startup (no file name in header)
- Added 3D view copy/paste buffers (selected objects). Shortcuts ctrl-c, ctrl-v (OSX, cmd-c, cmd-v).
Coded partial file saving for it. Could be used for other purposes. Todo: use OS clipboards.
- User preferences (themes, keymaps, user settings) now can be saved as a separate file.
Old option is called "Save Startup File" the new one "Save User Settings".
To visualise this difference, the 'save startup file' button has been removed from user preferences window. That option is available as CTRL+U and in File menu still.
- OSX: fixed bug that stopped giving mouse events outside window.
This also fixes "Continuous Grab" for OSX. (error since 2009)
2012-12-12 18:58:11 +00:00
|
|
|
prefsizey = ED_area_headersize();
|
2012-10-07 09:48:59 +00:00
|
|
|
}
|
2012-05-08 15:43:59 +00:00
|
|
|
else if (ar->regiontype == RGN_TYPE_UI && sa->spacetype == SPACE_FILE) {
|
|
|
|
prefsizey = UI_UNIT_Y * 2 + (UI_UNIT_Y / 2);
|
2011-10-03 04:48:14 +00:00
|
|
|
}
|
2012-10-07 09:48:59 +00:00
|
|
|
else {
|
2012-12-19 15:44:47 +00:00
|
|
|
prefsizey = UI_DPI_FAC * (ar->sizey > 1 ? ar->sizey + 0.5f : ar->type->prefsizey);
|
2012-10-07 09:48:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (ar->flag & RGN_FLAG_HIDDEN) {
|
|
|
|
/* hidden is user flag */
|
|
|
|
}
|
|
|
|
else if (alignment == RGN_ALIGN_FLOAT) {
|
|
|
|
/* XXX floating area region, not handled yet here */
|
|
|
|
}
|
2012-05-08 15:43:59 +00:00
|
|
|
else if (rct_fits(remainder, 'v', 1) < 0 || rct_fits(remainder, 'h', 1) < 0) {
|
2012-10-07 09:48:59 +00:00
|
|
|
/* remainder is too small for any usage */
|
2008-01-07 18:03:41 +00:00
|
|
|
ar->flag |= RGN_FLAG_TOO_SMALL;
|
|
|
|
}
|
2012-05-08 15:43:59 +00:00
|
|
|
else if (alignment == RGN_ALIGN_NONE) {
|
2008-01-07 18:03:41 +00:00
|
|
|
/* typically last region */
|
2012-05-08 15:43:59 +00:00
|
|
|
ar->winrct = *remainder;
|
2012-07-12 08:31:23 +00:00
|
|
|
BLI_rcti_init(remainder, 0, 0, 0, 0);
|
2008-01-07 18:03:41 +00:00
|
|
|
}
|
2012-05-08 15:43:59 +00:00
|
|
|
else if (alignment == RGN_ALIGN_TOP || alignment == RGN_ALIGN_BOTTOM) {
|
2008-01-07 18:03:41 +00:00
|
|
|
|
2012-05-08 15:43:59 +00:00
|
|
|
if (rct_fits(remainder, 'v', prefsizey) < 0) {
|
2008-01-07 18:03:41 +00:00
|
|
|
ar->flag |= RGN_FLAG_TOO_SMALL;
|
|
|
|
}
|
|
|
|
else {
|
2012-05-08 15:43:59 +00:00
|
|
|
int fac = rct_fits(remainder, 'v', prefsizey);
|
Various changes made in the process of working on the UI code:
* Added functions to generate Timer events. There was some unfinished code to
create one timer per window, this replaces that with a way to let operators
or other handlers add/remove their own timers as needed. This is currently
delivered as an event with the timer handle, perhaps this should be a notifier
instead? Also includes some fixes in ghost for timer events that were not
delivered in time, due to passing negative timeout.
* Added a Message event, which is a generic event that can be added by any
operator. This is used in the UI code to communicate the results of opened
blocks. Again, this may be better as a notifier.
* These two events should not be blocked as they are intended for a specific
operator or handler, so there were exceptions added for this, which is one
of the reasons they might work better as notifiers, but currently these
things can't listen to notifier yet.
* Added an option to events to indicate if the customdata should be freed or
not.
* Added a free() callback for area regions, and added a free function for
area regions in blenkernel since it was already there for screens and areas.
* Added ED_screen/area/region_exit functions to clean up things like operators
and handlers when they are closed.
* Added screen level regions, these will draw over areas boundaries, with the
last created region on top. These are useful for tooltips, menus, etc, and
are not saved to file. It's using the same ARegion struct as areas to avoid
code duplication, but perhaps that should be renamed then. Note that redraws
currently go correct, because only full window redraws are used, for partial
redraws without any frontbuffer drawing, the window manager needs to get
support for compositing subwindows.
* Minor changes in the subwindow code to retrieve the matrix, and moved
setlinestyle to glutil.c.
* Reversed argument order in WM_event_add/remove_keymap_handler to be consistent
with modal_handler.
* Operators can now block events but not necessarily cancel/finish.
* Modal operators are now stored in a list in the window/area/region they were
created in. This means for example that when a transform operator is invoked
from a region but registers a handler at the window level (since mouse motion
across areas should work), it will still get removed when the region is closed
while the operator is running.
2008-11-11 15:18:21 +00:00
|
|
|
|
2012-05-08 15:43:59 +00:00
|
|
|
if (fac < 0)
|
2008-12-10 13:56:54 +00:00
|
|
|
prefsizey += fac;
|
2008-01-07 18:03:41 +00:00
|
|
|
|
2012-05-08 15:43:59 +00:00
|
|
|
ar->winrct = *remainder;
|
2008-01-07 18:03:41 +00:00
|
|
|
|
2012-05-08 15:43:59 +00:00
|
|
|
if (alignment == RGN_ALIGN_TOP) {
|
2012-03-24 02:51:46 +00:00
|
|
|
ar->winrct.ymin = ar->winrct.ymax - prefsizey + 1;
|
|
|
|
remainder->ymax = ar->winrct.ymin - 1;
|
2008-01-07 18:03:41 +00:00
|
|
|
}
|
|
|
|
else {
|
2012-03-24 02:51:46 +00:00
|
|
|
ar->winrct.ymax = ar->winrct.ymin + prefsizey - 1;
|
|
|
|
remainder->ymin = ar->winrct.ymax + 1;
|
2008-01-07 18:03:41 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
Holiday coding log :)
Nice formatted version (pictures soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.66/Usability
Short list of main changes:
- Transparent region option (over main region), added code to blend in/out such panels.
- Min size window now 640 x 480
- Fixed DPI for ui - lots of cleanup and changes everywhere. Icon image need correct size still, layer-in-use icon needs remake.
- Macbook retina support, use command line --no-native-pixels to disable it
- Timeline Marker label was drawing wrong
- Trackpad and magic mouse: supports zoom (hold ctrl)
- Fix for splash position: removed ghost function and made window size update after creation immediate
- Fast undo buffer save now adds UI as well. Could be checked for regular file save even...
Quit.blend and temp file saving use this now.
- Dixed filename in window on reading quit.blend or temp saves, and they now add a warning in window title: "(Recovered)"
- New Userpref option "Keep Session" - this always saves quit.blend, and loads on start.
This allows keeping UI and data without actual saves, until you actually save.
When you load startup.blend and quit, it recognises the quit.blend as a startup (no file name in header)
- Added 3D view copy/paste buffers (selected objects). Shortcuts ctrl-c, ctrl-v (OSX, cmd-c, cmd-v).
Coded partial file saving for it. Could be used for other purposes. Todo: use OS clipboards.
- User preferences (themes, keymaps, user settings) now can be saved as a separate file.
Old option is called "Save Startup File" the new one "Save User Settings".
To visualise this difference, the 'save startup file' button has been removed from user preferences window. That option is available as CTRL+U and in File menu still.
- OSX: fixed bug that stopped giving mouse events outside window.
This also fixes "Continuous Grab" for OSX. (error since 2009)
2012-12-12 18:58:11 +00:00
|
|
|
else if (ELEM(alignment, RGN_ALIGN_LEFT, RGN_ALIGN_RIGHT)) {
|
2008-01-07 18:03:41 +00:00
|
|
|
|
2012-05-08 15:43:59 +00:00
|
|
|
if (rct_fits(remainder, 'h', prefsizex) < 0) {
|
2008-01-07 18:03:41 +00:00
|
|
|
ar->flag |= RGN_FLAG_TOO_SMALL;
|
|
|
|
}
|
|
|
|
else {
|
2012-05-08 15:43:59 +00:00
|
|
|
int fac = rct_fits(remainder, 'h', prefsizex);
|
2008-01-07 18:03:41 +00:00
|
|
|
|
2012-05-08 15:43:59 +00:00
|
|
|
if (fac < 0)
|
2008-12-10 13:56:54 +00:00
|
|
|
prefsizex += fac;
|
2008-01-07 18:03:41 +00:00
|
|
|
|
2012-05-08 15:43:59 +00:00
|
|
|
ar->winrct = *remainder;
|
2008-01-07 18:03:41 +00:00
|
|
|
|
Holiday coding log :)
Nice formatted version (pictures soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.66/Usability
Short list of main changes:
- Transparent region option (over main region), added code to blend in/out such panels.
- Min size window now 640 x 480
- Fixed DPI for ui - lots of cleanup and changes everywhere. Icon image need correct size still, layer-in-use icon needs remake.
- Macbook retina support, use command line --no-native-pixels to disable it
- Timeline Marker label was drawing wrong
- Trackpad and magic mouse: supports zoom (hold ctrl)
- Fix for splash position: removed ghost function and made window size update after creation immediate
- Fast undo buffer save now adds UI as well. Could be checked for regular file save even...
Quit.blend and temp file saving use this now.
- Dixed filename in window on reading quit.blend or temp saves, and they now add a warning in window title: "(Recovered)"
- New Userpref option "Keep Session" - this always saves quit.blend, and loads on start.
This allows keeping UI and data without actual saves, until you actually save.
When you load startup.blend and quit, it recognises the quit.blend as a startup (no file name in header)
- Added 3D view copy/paste buffers (selected objects). Shortcuts ctrl-c, ctrl-v (OSX, cmd-c, cmd-v).
Coded partial file saving for it. Could be used for other purposes. Todo: use OS clipboards.
- User preferences (themes, keymaps, user settings) now can be saved as a separate file.
Old option is called "Save Startup File" the new one "Save User Settings".
To visualise this difference, the 'save startup file' button has been removed from user preferences window. That option is available as CTRL+U and in File menu still.
- OSX: fixed bug that stopped giving mouse events outside window.
This also fixes "Continuous Grab" for OSX. (error since 2009)
2012-12-12 18:58:11 +00:00
|
|
|
if (alignment == RGN_ALIGN_RIGHT) {
|
2012-03-24 02:51:46 +00:00
|
|
|
ar->winrct.xmin = ar->winrct.xmax - prefsizex + 1;
|
Holiday coding log :)
Nice formatted version (pictures soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.66/Usability
Short list of main changes:
- Transparent region option (over main region), added code to blend in/out such panels.
- Min size window now 640 x 480
- Fixed DPI for ui - lots of cleanup and changes everywhere. Icon image need correct size still, layer-in-use icon needs remake.
- Macbook retina support, use command line --no-native-pixels to disable it
- Timeline Marker label was drawing wrong
- Trackpad and magic mouse: supports zoom (hold ctrl)
- Fix for splash position: removed ghost function and made window size update after creation immediate
- Fast undo buffer save now adds UI as well. Could be checked for regular file save even...
Quit.blend and temp file saving use this now.
- Dixed filename in window on reading quit.blend or temp saves, and they now add a warning in window title: "(Recovered)"
- New Userpref option "Keep Session" - this always saves quit.blend, and loads on start.
This allows keeping UI and data without actual saves, until you actually save.
When you load startup.blend and quit, it recognises the quit.blend as a startup (no file name in header)
- Added 3D view copy/paste buffers (selected objects). Shortcuts ctrl-c, ctrl-v (OSX, cmd-c, cmd-v).
Coded partial file saving for it. Could be used for other purposes. Todo: use OS clipboards.
- User preferences (themes, keymaps, user settings) now can be saved as a separate file.
Old option is called "Save Startup File" the new one "Save User Settings".
To visualise this difference, the 'save startup file' button has been removed from user preferences window. That option is available as CTRL+U and in File menu still.
- OSX: fixed bug that stopped giving mouse events outside window.
This also fixes "Continuous Grab" for OSX. (error since 2009)
2012-12-12 18:58:11 +00:00
|
|
|
if (ar->overlap == 0)
|
2012-03-24 02:51:46 +00:00
|
|
|
remainder->xmax = ar->winrct.xmin - 1;
|
2008-01-07 18:03:41 +00:00
|
|
|
}
|
|
|
|
else {
|
2012-03-24 02:51:46 +00:00
|
|
|
ar->winrct.xmax = ar->winrct.xmin + prefsizex - 1;
|
Holiday coding log :)
Nice formatted version (pictures soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.66/Usability
Short list of main changes:
- Transparent region option (over main region), added code to blend in/out such panels.
- Min size window now 640 x 480
- Fixed DPI for ui - lots of cleanup and changes everywhere. Icon image need correct size still, layer-in-use icon needs remake.
- Macbook retina support, use command line --no-native-pixels to disable it
- Timeline Marker label was drawing wrong
- Trackpad and magic mouse: supports zoom (hold ctrl)
- Fix for splash position: removed ghost function and made window size update after creation immediate
- Fast undo buffer save now adds UI as well. Could be checked for regular file save even...
Quit.blend and temp file saving use this now.
- Dixed filename in window on reading quit.blend or temp saves, and they now add a warning in window title: "(Recovered)"
- New Userpref option "Keep Session" - this always saves quit.blend, and loads on start.
This allows keeping UI and data without actual saves, until you actually save.
When you load startup.blend and quit, it recognises the quit.blend as a startup (no file name in header)
- Added 3D view copy/paste buffers (selected objects). Shortcuts ctrl-c, ctrl-v (OSX, cmd-c, cmd-v).
Coded partial file saving for it. Could be used for other purposes. Todo: use OS clipboards.
- User preferences (themes, keymaps, user settings) now can be saved as a separate file.
Old option is called "Save Startup File" the new one "Save User Settings".
To visualise this difference, the 'save startup file' button has been removed from user preferences window. That option is available as CTRL+U and in File menu still.
- OSX: fixed bug that stopped giving mouse events outside window.
This also fixes "Continuous Grab" for OSX. (error since 2009)
2012-12-12 18:58:11 +00:00
|
|
|
if (ar->overlap == 0)
|
2012-03-24 02:51:46 +00:00
|
|
|
remainder->xmin = ar->winrct.xmax + 1;
|
2008-01-07 18:03:41 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2012-05-08 15:43:59 +00:00
|
|
|
else if (alignment == RGN_ALIGN_VSPLIT || alignment == RGN_ALIGN_HSPLIT) {
|
2008-01-07 18:03:41 +00:00
|
|
|
/* percentage subdiv*/
|
2012-05-08 15:43:59 +00:00
|
|
|
ar->winrct = *remainder;
|
2008-01-07 18:03:41 +00:00
|
|
|
|
2012-05-08 15:43:59 +00:00
|
|
|
if (alignment == RGN_ALIGN_HSPLIT) {
|
|
|
|
if (rct_fits(remainder, 'h', prefsizex) > 4) {
|
2012-09-15 11:48:20 +00:00
|
|
|
ar->winrct.xmax = BLI_rcti_cent_x(remainder);
|
2012-05-08 15:43:59 +00:00
|
|
|
remainder->xmin = ar->winrct.xmax + 1;
|
2008-12-09 15:59:43 +00:00
|
|
|
}
|
|
|
|
else {
|
2012-07-12 08:31:23 +00:00
|
|
|
BLI_rcti_init(remainder, 0, 0, 0, 0);
|
2008-12-09 15:59:43 +00:00
|
|
|
}
|
2008-01-07 18:03:41 +00:00
|
|
|
}
|
|
|
|
else {
|
2012-05-08 15:43:59 +00:00
|
|
|
if (rct_fits(remainder, 'v', prefsizey) > 4) {
|
2012-09-15 11:48:20 +00:00
|
|
|
ar->winrct.ymax = BLI_rcti_cent_y(remainder);
|
2012-05-08 15:43:59 +00:00
|
|
|
remainder->ymin = ar->winrct.ymax + 1;
|
2008-12-09 15:59:43 +00:00
|
|
|
}
|
|
|
|
else {
|
2012-07-12 08:31:23 +00:00
|
|
|
BLI_rcti_init(remainder, 0, 0, 0, 0);
|
2008-12-09 15:59:43 +00:00
|
|
|
}
|
2008-01-07 18:03:41 +00:00
|
|
|
}
|
|
|
|
}
|
2012-05-08 15:43:59 +00:00
|
|
|
else if (alignment == RGN_ALIGN_QSPLIT) {
|
|
|
|
ar->winrct = *remainder;
|
2.5
View3D has been split now in a local part (RegionView3D) and a
per-area part (old View3D). Currently local is:
- view transform
- camera zoom/offset
- gpencil (todo)
- custom clipping planes
Rest is in Area still, like active camera, draw type, layers,
localview, custom centers, around-settings, transform widget,
gridlines, and so on (mostly stuff as available in header).
To see it work; also added new feature for region split,
press SHIFT+ALT+CTRL+S for four-split.
The idea is to make a preset 4-split, configured to stick
to top/right/front views for three views.
Another cool idea to explore is to then box-clip all drawing
based on these 3 views.
Note about the code:
- currently view3d still stores some depricated settings, to
convert from older files. Not all settings are copied over
though, like custom clip planes or the 'lock view to object'.
- since some view3d ops are now on area level, the operators
for it should keep track of that.
Bugfix in transform: quat initialize in operator-invoke missed
one zero.
Als brought back GE to compile for missing Ipos and channels.
2009-01-19 16:54:41 +00:00
|
|
|
|
|
|
|
/* test if there's still 4 regions left */
|
2012-05-08 15:43:59 +00:00
|
|
|
if (quad == 0) {
|
|
|
|
ARegion *artest = ar->next;
|
|
|
|
int count = 1;
|
2.5
View3D has been split now in a local part (RegionView3D) and a
per-area part (old View3D). Currently local is:
- view transform
- camera zoom/offset
- gpencil (todo)
- custom clipping planes
Rest is in Area still, like active camera, draw type, layers,
localview, custom centers, around-settings, transform widget,
gridlines, and so on (mostly stuff as available in header).
To see it work; also added new feature for region split,
press SHIFT+ALT+CTRL+S for four-split.
The idea is to make a preset 4-split, configured to stick
to top/right/front views for three views.
Another cool idea to explore is to then box-clip all drawing
based on these 3 views.
Note about the code:
- currently view3d still stores some depricated settings, to
convert from older files. Not all settings are copied over
though, like custom clip planes or the 'lock view to object'.
- since some view3d ops are now on area level, the operators
for it should keep track of that.
Bugfix in transform: quat initialize in operator-invoke missed
one zero.
Als brought back GE to compile for missing Ipos and channels.
2009-01-19 16:54:41 +00:00
|
|
|
|
2012-03-24 06:38:07 +00:00
|
|
|
while (artest) {
|
2012-05-08 15:43:59 +00:00
|
|
|
artest->alignment = RGN_ALIGN_QSPLIT;
|
|
|
|
artest = artest->next;
|
2.5
View3D has been split now in a local part (RegionView3D) and a
per-area part (old View3D). Currently local is:
- view transform
- camera zoom/offset
- gpencil (todo)
- custom clipping planes
Rest is in Area still, like active camera, draw type, layers,
localview, custom centers, around-settings, transform widget,
gridlines, and so on (mostly stuff as available in header).
To see it work; also added new feature for region split,
press SHIFT+ALT+CTRL+S for four-split.
The idea is to make a preset 4-split, configured to stick
to top/right/front views for three views.
Another cool idea to explore is to then box-clip all drawing
based on these 3 views.
Note about the code:
- currently view3d still stores some depricated settings, to
convert from older files. Not all settings are copied over
though, like custom clip planes or the 'lock view to object'.
- since some view3d ops are now on area level, the operators
for it should keep track of that.
Bugfix in transform: quat initialize in operator-invoke missed
one zero.
Als brought back GE to compile for missing Ipos and channels.
2009-01-19 16:54:41 +00:00
|
|
|
count++;
|
|
|
|
}
|
|
|
|
|
2012-05-08 15:43:59 +00:00
|
|
|
if (count != 4) {
|
2.5
View3D has been split now in a local part (RegionView3D) and a
per-area part (old View3D). Currently local is:
- view transform
- camera zoom/offset
- gpencil (todo)
- custom clipping planes
Rest is in Area still, like active camera, draw type, layers,
localview, custom centers, around-settings, transform widget,
gridlines, and so on (mostly stuff as available in header).
To see it work; also added new feature for region split,
press SHIFT+ALT+CTRL+S for four-split.
The idea is to make a preset 4-split, configured to stick
to top/right/front views for three views.
Another cool idea to explore is to then box-clip all drawing
based on these 3 views.
Note about the code:
- currently view3d still stores some depricated settings, to
convert from older files. Not all settings are copied over
though, like custom clip planes or the 'lock view to object'.
- since some view3d ops are now on area level, the operators
for it should keep track of that.
Bugfix in transform: quat initialize in operator-invoke missed
one zero.
Als brought back GE to compile for missing Ipos and channels.
2009-01-19 16:54:41 +00:00
|
|
|
/* let's stop adding regions */
|
2012-07-12 08:31:23 +00:00
|
|
|
BLI_rcti_init(remainder, 0, 0, 0, 0);
|
2012-03-31 00:59:17 +00:00
|
|
|
if (G.debug & G_DEBUG)
|
2010-01-22 06:48:29 +00:00
|
|
|
printf("region quadsplit failed\n");
|
2.5
View3D has been split now in a local part (RegionView3D) and a
per-area part (old View3D). Currently local is:
- view transform
- camera zoom/offset
- gpencil (todo)
- custom clipping planes
Rest is in Area still, like active camera, draw type, layers,
localview, custom centers, around-settings, transform widget,
gridlines, and so on (mostly stuff as available in header).
To see it work; also added new feature for region split,
press SHIFT+ALT+CTRL+S for four-split.
The idea is to make a preset 4-split, configured to stick
to top/right/front views for three views.
Another cool idea to explore is to then box-clip all drawing
based on these 3 views.
Note about the code:
- currently view3d still stores some depricated settings, to
convert from older files. Not all settings are copied over
though, like custom clip planes or the 'lock view to object'.
- since some view3d ops are now on area level, the operators
for it should keep track of that.
Bugfix in transform: quat initialize in operator-invoke missed
one zero.
Als brought back GE to compile for missing Ipos and channels.
2009-01-19 16:54:41 +00:00
|
|
|
}
|
2013-03-09 03:46:30 +00:00
|
|
|
else {
|
|
|
|
quad = 1;
|
|
|
|
}
|
2.5
View3D has been split now in a local part (RegionView3D) and a
per-area part (old View3D). Currently local is:
- view transform
- camera zoom/offset
- gpencil (todo)
- custom clipping planes
Rest is in Area still, like active camera, draw type, layers,
localview, custom centers, around-settings, transform widget,
gridlines, and so on (mostly stuff as available in header).
To see it work; also added new feature for region split,
press SHIFT+ALT+CTRL+S for four-split.
The idea is to make a preset 4-split, configured to stick
to top/right/front views for three views.
Another cool idea to explore is to then box-clip all drawing
based on these 3 views.
Note about the code:
- currently view3d still stores some depricated settings, to
convert from older files. Not all settings are copied over
though, like custom clip planes or the 'lock view to object'.
- since some view3d ops are now on area level, the operators
for it should keep track of that.
Bugfix in transform: quat initialize in operator-invoke missed
one zero.
Als brought back GE to compile for missing Ipos and channels.
2009-01-19 16:54:41 +00:00
|
|
|
}
|
2012-03-24 06:38:07 +00:00
|
|
|
if (quad) {
|
2012-05-08 15:43:59 +00:00
|
|
|
if (quad == 1) { /* left bottom */
|
2012-09-15 11:48:20 +00:00
|
|
|
ar->winrct.xmax = BLI_rcti_cent_x(remainder);
|
|
|
|
ar->winrct.ymax = BLI_rcti_cent_y(remainder);
|
2.5
View3D has been split now in a local part (RegionView3D) and a
per-area part (old View3D). Currently local is:
- view transform
- camera zoom/offset
- gpencil (todo)
- custom clipping planes
Rest is in Area still, like active camera, draw type, layers,
localview, custom centers, around-settings, transform widget,
gridlines, and so on (mostly stuff as available in header).
To see it work; also added new feature for region split,
press SHIFT+ALT+CTRL+S for four-split.
The idea is to make a preset 4-split, configured to stick
to top/right/front views for three views.
Another cool idea to explore is to then box-clip all drawing
based on these 3 views.
Note about the code:
- currently view3d still stores some depricated settings, to
convert from older files. Not all settings are copied over
though, like custom clip planes or the 'lock view to object'.
- since some view3d ops are now on area level, the operators
for it should keep track of that.
Bugfix in transform: quat initialize in operator-invoke missed
one zero.
Als brought back GE to compile for missing Ipos and channels.
2009-01-19 16:54:41 +00:00
|
|
|
}
|
2012-05-08 15:43:59 +00:00
|
|
|
else if (quad == 2) { /* left top */
|
2012-09-15 11:48:20 +00:00
|
|
|
ar->winrct.xmax = BLI_rcti_cent_x(remainder);
|
|
|
|
ar->winrct.ymin = BLI_rcti_cent_y(remainder) + 1;
|
2.5
View3D has been split now in a local part (RegionView3D) and a
per-area part (old View3D). Currently local is:
- view transform
- camera zoom/offset
- gpencil (todo)
- custom clipping planes
Rest is in Area still, like active camera, draw type, layers,
localview, custom centers, around-settings, transform widget,
gridlines, and so on (mostly stuff as available in header).
To see it work; also added new feature for region split,
press SHIFT+ALT+CTRL+S for four-split.
The idea is to make a preset 4-split, configured to stick
to top/right/front views for three views.
Another cool idea to explore is to then box-clip all drawing
based on these 3 views.
Note about the code:
- currently view3d still stores some depricated settings, to
convert from older files. Not all settings are copied over
though, like custom clip planes or the 'lock view to object'.
- since some view3d ops are now on area level, the operators
for it should keep track of that.
Bugfix in transform: quat initialize in operator-invoke missed
one zero.
Als brought back GE to compile for missing Ipos and channels.
2009-01-19 16:54:41 +00:00
|
|
|
}
|
2012-05-08 15:43:59 +00:00
|
|
|
else if (quad == 3) { /* right bottom */
|
2012-09-15 11:48:20 +00:00
|
|
|
ar->winrct.xmin = BLI_rcti_cent_x(remainder) + 1;
|
|
|
|
ar->winrct.ymax = BLI_rcti_cent_y(remainder);
|
2.5
View3D has been split now in a local part (RegionView3D) and a
per-area part (old View3D). Currently local is:
- view transform
- camera zoom/offset
- gpencil (todo)
- custom clipping planes
Rest is in Area still, like active camera, draw type, layers,
localview, custom centers, around-settings, transform widget,
gridlines, and so on (mostly stuff as available in header).
To see it work; also added new feature for region split,
press SHIFT+ALT+CTRL+S for four-split.
The idea is to make a preset 4-split, configured to stick
to top/right/front views for three views.
Another cool idea to explore is to then box-clip all drawing
based on these 3 views.
Note about the code:
- currently view3d still stores some depricated settings, to
convert from older files. Not all settings are copied over
though, like custom clip planes or the 'lock view to object'.
- since some view3d ops are now on area level, the operators
for it should keep track of that.
Bugfix in transform: quat initialize in operator-invoke missed
one zero.
Als brought back GE to compile for missing Ipos and channels.
2009-01-19 16:54:41 +00:00
|
|
|
}
|
2012-05-08 15:43:59 +00:00
|
|
|
else { /* right top */
|
2012-09-15 11:48:20 +00:00
|
|
|
ar->winrct.xmin = BLI_rcti_cent_x(remainder) + 1;
|
|
|
|
ar->winrct.ymin = BLI_rcti_cent_y(remainder) + 1;
|
2012-07-12 08:31:23 +00:00
|
|
|
BLI_rcti_init(remainder, 0, 0, 0, 0);
|
2.5
View3D has been split now in a local part (RegionView3D) and a
per-area part (old View3D). Currently local is:
- view transform
- camera zoom/offset
- gpencil (todo)
- custom clipping planes
Rest is in Area still, like active camera, draw type, layers,
localview, custom centers, around-settings, transform widget,
gridlines, and so on (mostly stuff as available in header).
To see it work; also added new feature for region split,
press SHIFT+ALT+CTRL+S for four-split.
The idea is to make a preset 4-split, configured to stick
to top/right/front views for three views.
Another cool idea to explore is to then box-clip all drawing
based on these 3 views.
Note about the code:
- currently view3d still stores some depricated settings, to
convert from older files. Not all settings are copied over
though, like custom clip planes or the 'lock view to object'.
- since some view3d ops are now on area level, the operators
for it should keep track of that.
Bugfix in transform: quat initialize in operator-invoke missed
one zero.
Als brought back GE to compile for missing Ipos and channels.
2009-01-19 16:54:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
quad++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-12-10 13:56:54 +00:00
|
|
|
/* for speedup */
|
2012-09-15 11:48:20 +00:00
|
|
|
ar->winx = BLI_rcti_size_x(&ar->winrct) + 1;
|
|
|
|
ar->winy = BLI_rcti_size_y(&ar->winrct) + 1;
|
2008-01-07 18:03:41 +00:00
|
|
|
|
2012-12-16 14:19:29 +00:00
|
|
|
/* if region opened normally, we store this for hide/reveal usage */
|
2012-12-19 15:44:47 +00:00
|
|
|
/* prevent rounding errors for UI_DPI_FAC mult and divide */
|
|
|
|
if (ar->winx > 1) ar->sizex = (ar->winx + 0.5f) / UI_DPI_FAC;
|
|
|
|
if (ar->winy > 1) ar->sizey = (ar->winy + 0.5f) / UI_DPI_FAC;
|
2012-12-16 14:19:29 +00:00
|
|
|
|
2012-12-19 16:16:20 +00:00
|
|
|
/* exception for multiple overlapping regions on same spot */
|
2012-12-13 17:43:12 +00:00
|
|
|
if (ar->overlap)
|
2012-12-19 16:16:20 +00:00
|
|
|
region_overlap_fix(sa, ar);
|
2012-12-13 17:43:12 +00:00
|
|
|
|
2.5
First version of region-scaling. WIP commit, so bear with me a while!
- All fixed sized regions have a small 'drag' widget, on the left or top.
(not yet for free-sized regions, like 4-split).
- Mouse-over on widget changes cursor and allows drag.
- Click on widget hides/reveals.
- Fun for test; 3d view header, if high enough, draws more rows of
buttons when width is too small.
The WIP stuff;
- It doesn't save yet in files, using the "minsize" variable of region
definitions, also means other similar areas show same sizes now.
- Definitions for pref size, min/max will be added.
- Properties panel in Fcurve window draws widget on wrong place when
hidden (subdiv system needs tweak)
- Widgets don't draw perfect yet, also needs further tweaks.
But, in general it's quite fun and usable. :) Many variatians are possible,
like for real tabs, or little icons, or just click-drag on edge.
The reason to first try the widget/tab variation:
- it re-uses the "Area Action Zone" code, widgets for layouting Screens
- it's visible, hotkey-only options for screen layouts are not preferred.
- distinguish clearly area-edges from region-edges this way. Having the
cursor change shape on every edge (and block input) is probably annoying
too... but that can be tested.
Later more!
2009-05-24 13:29:29 +00:00
|
|
|
/* set winrect for azones */
|
2012-05-08 15:43:59 +00:00
|
|
|
if (ar->flag & (RGN_FLAG_HIDDEN | RGN_FLAG_TOO_SMALL)) {
|
|
|
|
ar->winrct = *remainder;
|
2.5
First version of region-scaling. WIP commit, so bear with me a while!
- All fixed sized regions have a small 'drag' widget, on the left or top.
(not yet for free-sized regions, like 4-split).
- Mouse-over on widget changes cursor and allows drag.
- Click on widget hides/reveals.
- Fun for test; 3d view header, if high enough, draws more rows of
buttons when width is too small.
The WIP stuff;
- It doesn't save yet in files, using the "minsize" variable of region
definitions, also means other similar areas show same sizes now.
- Definitions for pref size, min/max will be added.
- Properties panel in Fcurve window draws widget on wrong place when
hidden (subdiv system needs tweak)
- Widgets don't draw perfect yet, also needs further tweaks.
But, in general it's quite fun and usable. :) Many variatians are possible,
like for real tabs, or little icons, or just click-drag on edge.
The reason to first try the widget/tab variation:
- it re-uses the "Area Action Zone" code, widgets for layouting Screens
- it's visible, hotkey-only options for screen layouts are not preferred.
- distinguish clearly area-edges from region-edges this way. Having the
cursor change shape on every edge (and block input) is probably annoying
too... but that can be tested.
Later more!
2009-05-24 13:29:29 +00:00
|
|
|
|
2015-05-14 23:58:08 +02:00
|
|
|
switch (alignment) {
|
|
|
|
case RGN_ALIGN_TOP:
|
|
|
|
ar->winrct.ymin = ar->winrct.ymax;
|
|
|
|
break;
|
|
|
|
case RGN_ALIGN_BOTTOM:
|
|
|
|
ar->winrct.ymax = ar->winrct.ymin;
|
|
|
|
break;
|
|
|
|
case RGN_ALIGN_RIGHT:
|
|
|
|
ar->winrct.xmin = ar->winrct.xmax;
|
|
|
|
break;
|
|
|
|
case RGN_ALIGN_LEFT:
|
|
|
|
default:
|
|
|
|
/* prevent winrct to be valid */
|
|
|
|
ar->winrct.xmax = ar->winrct.xmin;
|
|
|
|
break;
|
|
|
|
}
|
2.5
First version of region-scaling. WIP commit, so bear with me a while!
- All fixed sized regions have a small 'drag' widget, on the left or top.
(not yet for free-sized regions, like 4-split).
- Mouse-over on widget changes cursor and allows drag.
- Click on widget hides/reveals.
- Fun for test; 3d view header, if high enough, draws more rows of
buttons when width is too small.
The WIP stuff;
- It doesn't save yet in files, using the "minsize" variable of region
definitions, also means other similar areas show same sizes now.
- Definitions for pref size, min/max will be added.
- Properties panel in Fcurve window draws widget on wrong place when
hidden (subdiv system needs tweak)
- Widgets don't draw perfect yet, also needs further tweaks.
But, in general it's quite fun and usable. :) Many variatians are possible,
like for real tabs, or little icons, or just click-drag on edge.
The reason to first try the widget/tab variation:
- it re-uses the "Area Action Zone" code, widgets for layouting Screens
- it's visible, hotkey-only options for screen layouts are not preferred.
- distinguish clearly area-edges from region-edges this way. Having the
cursor change shape on every edge (and block input) is probably annoying
too... but that can be tested.
Later more!
2009-05-24 13:29:29 +00:00
|
|
|
}
|
Todo item:
Closed regions didn't always draw the (+) icon right place, confusing
for users.
Next to that, I think this icon is using a bad metaphor or visual language,
Illustrated best if you close a header in outliner or buttons. Icons are
UI widgets, for screen/editor layouts different controls can be stylized.
My preference is something that aligns visually to the seperators between
regions; for testing and hacking pleasure I've added two quick versions,
a small tabbish thing and a triangle. Enable these with debug menu,
ALT+CTRL+D, values 1 or 2.
This is simply drawn with opengl now. An image for it can be made as well.
Previews:
http://www.blender.org/bf/closed_regions1.png
http://www.blender.org/bf/closed_regions2.png
http://www.blender.org/bf/closed_regions3.png
There's other design ideas to explore as well, like making region deviders
8-10 pixels wide, with a 'drag me' dot on it or so. That takes some screen
estate though, and will require to add big editor-dividers too...
Fun stuff for the mockup-mafia to check on, we have time :)
2011-06-30 15:02:03 +00:00
|
|
|
|
|
|
|
/* restore prev-split exception */
|
2012-03-24 06:38:07 +00:00
|
|
|
if (ar->alignment & RGN_SPLIT_PREV) {
|
|
|
|
if (ar->prev) {
|
2012-05-08 15:43:59 +00:00
|
|
|
remainder = remainder_prev;
|
2012-09-15 11:48:20 +00:00
|
|
|
ar->prev->winx = BLI_rcti_size_x(&ar->prev->winrct) + 1;
|
|
|
|
ar->prev->winy = BLI_rcti_size_y(&ar->prev->winrct) + 1;
|
Todo item:
Closed regions didn't always draw the (+) icon right place, confusing
for users.
Next to that, I think this icon is using a bad metaphor or visual language,
Illustrated best if you close a header in outliner or buttons. Icons are
UI widgets, for screen/editor layouts different controls can be stylized.
My preference is something that aligns visually to the seperators between
regions; for testing and hacking pleasure I've added two quick versions,
a small tabbish thing and a triangle. Enable these with debug menu,
ALT+CTRL+D, values 1 or 2.
This is simply drawn with opengl now. An image for it can be made as well.
Previews:
http://www.blender.org/bf/closed_regions1.png
http://www.blender.org/bf/closed_regions2.png
http://www.blender.org/bf/closed_regions3.png
There's other design ideas to explore as well, like making region deviders
8-10 pixels wide, with a 'drag me' dot on it or so. That takes some screen
estate though, and will require to add big editor-dividers too...
Fun stuff for the mockup-mafia to check on, we have time :)
2011-06-30 15:02:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2.5
First version of region-scaling. WIP commit, so bear with me a while!
- All fixed sized regions have a small 'drag' widget, on the left or top.
(not yet for free-sized regions, like 4-split).
- Mouse-over on widget changes cursor and allows drag.
- Click on widget hides/reveals.
- Fun for test; 3d view header, if high enough, draws more rows of
buttons when width is too small.
The WIP stuff;
- It doesn't save yet in files, using the "minsize" variable of region
definitions, also means other similar areas show same sizes now.
- Definitions for pref size, min/max will be added.
- Properties panel in Fcurve window draws widget on wrong place when
hidden (subdiv system needs tweak)
- Widgets don't draw perfect yet, also needs further tweaks.
But, in general it's quite fun and usable. :) Many variatians are possible,
like for real tabs, or little icons, or just click-drag on edge.
The reason to first try the widget/tab variation:
- it re-uses the "Area Action Zone" code, widgets for layouting Screens
- it's visible, hotkey-only options for screen layouts are not preferred.
- distinguish clearly area-edges from region-edges this way. Having the
cursor change shape on every edge (and block input) is probably annoying
too... but that can be tested.
Later more!
2009-05-24 13:29:29 +00:00
|
|
|
/* in end, add azones, where appropriate */
|
2012-03-24 06:38:07 +00:00
|
|
|
if (ar->regiontype == RGN_TYPE_HEADER && ar->winy + 6 > sa->winy) {
|
2011-06-05 09:22:14 +00:00
|
|
|
/* The logic for this is: when the header takes up the full area,
|
|
|
|
* disallow hiding it to view the main window.
|
|
|
|
*
|
Todo item:
Closed regions didn't always draw the (+) icon right place, confusing
for users.
Next to that, I think this icon is using a bad metaphor or visual language,
Illustrated best if you close a header in outliner or buttons. Icons are
UI widgets, for screen/editor layouts different controls can be stylized.
My preference is something that aligns visually to the seperators between
regions; for testing and hacking pleasure I've added two quick versions,
a small tabbish thing and a triangle. Enable these with debug menu,
ALT+CTRL+D, values 1 or 2.
This is simply drawn with opengl now. An image for it can be made as well.
Previews:
http://www.blender.org/bf/closed_regions1.png
http://www.blender.org/bf/closed_regions2.png
http://www.blender.org/bf/closed_regions3.png
There's other design ideas to explore as well, like making region deviders
8-10 pixels wide, with a 'drag me' dot on it or so. That takes some screen
estate though, and will require to add big editor-dividers too...
Fun stuff for the mockup-mafia to check on, we have time :)
2011-06-30 15:02:03 +00:00
|
|
|
* Without this, you can drag down the file selectors header and hide it
|
2011-06-05 09:22:14 +00:00
|
|
|
* by accident very easily (highly annoying!), the value 6 is arbitrary
|
|
|
|
* but accounts for small common rounding problems when scaling the UI,
|
|
|
|
* must be minimum '4' */
|
|
|
|
}
|
|
|
|
else {
|
2014-10-14 15:05:44 -03:00
|
|
|
if (ELEM(win->screen->state, SCREENNORMAL, SCREENMAXIMIZED)) {
|
|
|
|
region_azone_add(sa, ar, alignment, false);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
region_azone_add(sa, ar, alignment, true);
|
|
|
|
fullscreen_azone_initialize(sa, ar);
|
|
|
|
}
|
2011-06-05 09:22:14 +00:00
|
|
|
}
|
2.5
First version of region-scaling. WIP commit, so bear with me a while!
- All fixed sized regions have a small 'drag' widget, on the left or top.
(not yet for free-sized regions, like 4-split).
- Mouse-over on widget changes cursor and allows drag.
- Click on widget hides/reveals.
- Fun for test; 3d view header, if high enough, draws more rows of
buttons when width is too small.
The WIP stuff;
- It doesn't save yet in files, using the "minsize" variable of region
definitions, also means other similar areas show same sizes now.
- Definitions for pref size, min/max will be added.
- Properties panel in Fcurve window draws widget on wrong place when
hidden (subdiv system needs tweak)
- Widgets don't draw perfect yet, also needs further tweaks.
But, in general it's quite fun and usable. :) Many variatians are possible,
like for real tabs, or little icons, or just click-drag on edge.
The reason to first try the widget/tab variation:
- it re-uses the "Area Action Zone" code, widgets for layouting Screens
- it's visible, hotkey-only options for screen layouts are not preferred.
- distinguish clearly area-edges from region-edges this way. Having the
cursor change shape on every edge (and block input) is probably annoying
too... but that can be tested.
Later more!
2009-05-24 13:29:29 +00:00
|
|
|
|
Holiday coding log :)
Nice formatted version (pictures soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.66/Usability
Short list of main changes:
- Transparent region option (over main region), added code to blend in/out such panels.
- Min size window now 640 x 480
- Fixed DPI for ui - lots of cleanup and changes everywhere. Icon image need correct size still, layer-in-use icon needs remake.
- Macbook retina support, use command line --no-native-pixels to disable it
- Timeline Marker label was drawing wrong
- Trackpad and magic mouse: supports zoom (hold ctrl)
- Fix for splash position: removed ghost function and made window size update after creation immediate
- Fast undo buffer save now adds UI as well. Could be checked for regular file save even...
Quit.blend and temp file saving use this now.
- Dixed filename in window on reading quit.blend or temp saves, and they now add a warning in window title: "(Recovered)"
- New Userpref option "Keep Session" - this always saves quit.blend, and loads on start.
This allows keeping UI and data without actual saves, until you actually save.
When you load startup.blend and quit, it recognises the quit.blend as a startup (no file name in header)
- Added 3D view copy/paste buffers (selected objects). Shortcuts ctrl-c, ctrl-v (OSX, cmd-c, cmd-v).
Coded partial file saving for it. Could be used for other purposes. Todo: use OS clipboards.
- User preferences (themes, keymaps, user settings) now can be saved as a separate file.
Old option is called "Save Startup File" the new one "Save User Settings".
To visualise this difference, the 'save startup file' button has been removed from user preferences window. That option is available as CTRL+U and in File menu still.
- OSX: fixed bug that stopped giving mouse events outside window.
This also fixes "Continuous Grab" for OSX. (error since 2009)
2012-12-12 18:58:11 +00:00
|
|
|
region_rect_recursive(win, sa, ar->next, remainder, quad);
|
2008-01-07 18:03:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void area_calc_totrct(ScrArea *sa, int sizex, int sizey)
|
|
|
|
{
|
2013-11-25 13:40:58 +01:00
|
|
|
short rt = (short) U.pixelsize;
|
2009-05-22 15:02:32 +00:00
|
|
|
|
2013-11-25 13:40:58 +01:00
|
|
|
if (sa->v1->vec.x > 0) sa->totrct.xmin = sa->v1->vec.x + rt;
|
2012-03-24 02:51:46 +00:00
|
|
|
else sa->totrct.xmin = sa->v1->vec.x;
|
2013-11-25 13:40:58 +01:00
|
|
|
if (sa->v4->vec.x < sizex - 1) sa->totrct.xmax = sa->v4->vec.x - rt;
|
2012-03-24 02:51:46 +00:00
|
|
|
else sa->totrct.xmax = sa->v4->vec.x;
|
2008-01-07 18:03:41 +00:00
|
|
|
|
2013-11-25 13:40:58 +01:00
|
|
|
if (sa->v1->vec.y > 0) sa->totrct.ymin = sa->v1->vec.y + rt;
|
2012-03-24 02:51:46 +00:00
|
|
|
else sa->totrct.ymin = sa->v1->vec.y;
|
2013-11-25 13:40:58 +01:00
|
|
|
if (sa->v2->vec.y < sizey - 1) sa->totrct.ymax = sa->v2->vec.y - rt;
|
2012-03-24 02:51:46 +00:00
|
|
|
else sa->totrct.ymax = sa->v2->vec.y;
|
2008-01-07 18:03:41 +00:00
|
|
|
|
|
|
|
/* for speedup */
|
2012-09-15 11:48:20 +00:00
|
|
|
sa->winx = BLI_rcti_size_x(&sa->totrct) + 1;
|
|
|
|
sa->winy = BLI_rcti_size_y(&sa->totrct) + 1;
|
2008-01-07 18:03:41 +00:00
|
|
|
}
|
|
|
|
|
2008-12-16 18:42:12 +00:00
|
|
|
|
2008-12-10 13:56:54 +00:00
|
|
|
/* used for area initialize below */
|
2010-10-14 12:24:08 +00:00
|
|
|
static void region_subwindow(wmWindow *win, ARegion *ar)
|
Various changes made in the process of working on the UI code:
* Added functions to generate Timer events. There was some unfinished code to
create one timer per window, this replaces that with a way to let operators
or other handlers add/remove their own timers as needed. This is currently
delivered as an event with the timer handle, perhaps this should be a notifier
instead? Also includes some fixes in ghost for timer events that were not
delivered in time, due to passing negative timeout.
* Added a Message event, which is a generic event that can be added by any
operator. This is used in the UI code to communicate the results of opened
blocks. Again, this may be better as a notifier.
* These two events should not be blocked as they are intended for a specific
operator or handler, so there were exceptions added for this, which is one
of the reasons they might work better as notifiers, but currently these
things can't listen to notifier yet.
* Added an option to events to indicate if the customdata should be freed or
not.
* Added a free() callback for area regions, and added a free function for
area regions in blenkernel since it was already there for screens and areas.
* Added ED_screen/area/region_exit functions to clean up things like operators
and handlers when they are closed.
* Added screen level regions, these will draw over areas boundaries, with the
last created region on top. These are useful for tooltips, menus, etc, and
are not saved to file. It's using the same ARegion struct as areas to avoid
code duplication, but perhaps that should be renamed then. Note that redraws
currently go correct, because only full window redraws are used, for partial
redraws without any frontbuffer drawing, the window manager needs to get
support for compositing subwindows.
* Minor changes in the subwindow code to retrieve the matrix, and moved
setlinestyle to glutil.c.
* Reversed argument order in WM_event_add/remove_keymap_handler to be consistent
with modal_handler.
* Operators can now block events but not necessarily cancel/finish.
* Modal operators are now stored in a list in the window/area/region they were
created in. This means for example that when a transform operator is invoked
from a region but registers a handler at the window level (since mouse motion
across areas should work), it will still get removed when the region is closed
while the operator is running.
2008-11-11 15:18:21 +00:00
|
|
|
{
|
2014-01-22 16:35:11 +01:00
|
|
|
bool hidden = (ar->flag & (RGN_FLAG_HIDDEN | RGN_FLAG_TOO_SMALL)) != 0;
|
|
|
|
|
|
|
|
if ((ar->alignment & RGN_SPLIT_PREV) && ar->prev)
|
|
|
|
hidden = hidden || (ar->prev->flag & (RGN_FLAG_HIDDEN | RGN_FLAG_TOO_SMALL));
|
|
|
|
|
|
|
|
if (hidden) {
|
2012-03-24 06:38:07 +00:00
|
|
|
if (ar->swinid)
|
Various changes made in the process of working on the UI code:
* Added functions to generate Timer events. There was some unfinished code to
create one timer per window, this replaces that with a way to let operators
or other handlers add/remove their own timers as needed. This is currently
delivered as an event with the timer handle, perhaps this should be a notifier
instead? Also includes some fixes in ghost for timer events that were not
delivered in time, due to passing negative timeout.
* Added a Message event, which is a generic event that can be added by any
operator. This is used in the UI code to communicate the results of opened
blocks. Again, this may be better as a notifier.
* These two events should not be blocked as they are intended for a specific
operator or handler, so there were exceptions added for this, which is one
of the reasons they might work better as notifiers, but currently these
things can't listen to notifier yet.
* Added an option to events to indicate if the customdata should be freed or
not.
* Added a free() callback for area regions, and added a free function for
area regions in blenkernel since it was already there for screens and areas.
* Added ED_screen/area/region_exit functions to clean up things like operators
and handlers when they are closed.
* Added screen level regions, these will draw over areas boundaries, with the
last created region on top. These are useful for tooltips, menus, etc, and
are not saved to file. It's using the same ARegion struct as areas to avoid
code duplication, but perhaps that should be renamed then. Note that redraws
currently go correct, because only full window redraws are used, for partial
redraws without any frontbuffer drawing, the window manager needs to get
support for compositing subwindows.
* Minor changes in the subwindow code to retrieve the matrix, and moved
setlinestyle to glutil.c.
* Reversed argument order in WM_event_add/remove_keymap_handler to be consistent
with modal_handler.
* Operators can now block events but not necessarily cancel/finish.
* Modal operators are now stored in a list in the window/area/region they were
created in. This means for example that when a transform operator is invoked
from a region but registers a handler at the window level (since mouse motion
across areas should work), it will still get removed when the region is closed
while the operator is running.
2008-11-11 15:18:21 +00:00
|
|
|
wm_subwindow_close(win, ar->swinid);
|
2012-05-08 15:43:59 +00:00
|
|
|
ar->swinid = 0;
|
Various changes made in the process of working on the UI code:
* Added functions to generate Timer events. There was some unfinished code to
create one timer per window, this replaces that with a way to let operators
or other handlers add/remove their own timers as needed. This is currently
delivered as an event with the timer handle, perhaps this should be a notifier
instead? Also includes some fixes in ghost for timer events that were not
delivered in time, due to passing negative timeout.
* Added a Message event, which is a generic event that can be added by any
operator. This is used in the UI code to communicate the results of opened
blocks. Again, this may be better as a notifier.
* These two events should not be blocked as they are intended for a specific
operator or handler, so there were exceptions added for this, which is one
of the reasons they might work better as notifiers, but currently these
things can't listen to notifier yet.
* Added an option to events to indicate if the customdata should be freed or
not.
* Added a free() callback for area regions, and added a free function for
area regions in blenkernel since it was already there for screens and areas.
* Added ED_screen/area/region_exit functions to clean up things like operators
and handlers when they are closed.
* Added screen level regions, these will draw over areas boundaries, with the
last created region on top. These are useful for tooltips, menus, etc, and
are not saved to file. It's using the same ARegion struct as areas to avoid
code duplication, but perhaps that should be renamed then. Note that redraws
currently go correct, because only full window redraws are used, for partial
redraws without any frontbuffer drawing, the window manager needs to get
support for compositing subwindows.
* Minor changes in the subwindow code to retrieve the matrix, and moved
setlinestyle to glutil.c.
* Reversed argument order in WM_event_add/remove_keymap_handler to be consistent
with modal_handler.
* Operators can now block events but not necessarily cancel/finish.
* Modal operators are now stored in a list in the window/area/region they were
created in. This means for example that when a transform operator is invoked
from a region but registers a handler at the window level (since mouse motion
across areas should work), it will still get removed when the region is closed
while the operator is running.
2008-11-11 15:18:21 +00:00
|
|
|
}
|
2012-05-08 15:43:59 +00:00
|
|
|
else if (ar->swinid == 0)
|
|
|
|
ar->swinid = wm_subwindow_open(win, &ar->winrct);
|
Various changes made in the process of working on the UI code:
* Added functions to generate Timer events. There was some unfinished code to
create one timer per window, this replaces that with a way to let operators
or other handlers add/remove their own timers as needed. This is currently
delivered as an event with the timer handle, perhaps this should be a notifier
instead? Also includes some fixes in ghost for timer events that were not
delivered in time, due to passing negative timeout.
* Added a Message event, which is a generic event that can be added by any
operator. This is used in the UI code to communicate the results of opened
blocks. Again, this may be better as a notifier.
* These two events should not be blocked as they are intended for a specific
operator or handler, so there were exceptions added for this, which is one
of the reasons they might work better as notifiers, but currently these
things can't listen to notifier yet.
* Added an option to events to indicate if the customdata should be freed or
not.
* Added a free() callback for area regions, and added a free function for
area regions in blenkernel since it was already there for screens and areas.
* Added ED_screen/area/region_exit functions to clean up things like operators
and handlers when they are closed.
* Added screen level regions, these will draw over areas boundaries, with the
last created region on top. These are useful for tooltips, menus, etc, and
are not saved to file. It's using the same ARegion struct as areas to avoid
code duplication, but perhaps that should be renamed then. Note that redraws
currently go correct, because only full window redraws are used, for partial
redraws without any frontbuffer drawing, the window manager needs to get
support for compositing subwindows.
* Minor changes in the subwindow code to retrieve the matrix, and moved
setlinestyle to glutil.c.
* Reversed argument order in WM_event_add/remove_keymap_handler to be consistent
with modal_handler.
* Operators can now block events but not necessarily cancel/finish.
* Modal operators are now stored in a list in the window/area/region they were
created in. This means for example that when a transform operator is invoked
from a region but registers a handler at the window level (since mouse motion
across areas should work), it will still get removed when the region is closed
while the operator is running.
2008-11-11 15:18:21 +00:00
|
|
|
else
|
|
|
|
wm_subwindow_position(win, ar->swinid, &ar->winrct);
|
|
|
|
}
|
|
|
|
|
2011-03-07 18:05:41 +00:00
|
|
|
static void ed_default_handlers(wmWindowManager *wm, ScrArea *sa, ListBase *handlers, int flag)
|
2008-12-10 13:56:54 +00:00
|
|
|
{
|
|
|
|
/* note, add-handler checks if it already exists */
|
|
|
|
|
2012-07-07 22:51:57 +00:00
|
|
|
/* XXX it would be good to have boundbox checks for some of these... */
|
2012-03-24 06:38:07 +00:00
|
|
|
if (flag & ED_KEYMAP_UI) {
|
2009-11-27 06:24:09 +00:00
|
|
|
/* user interface widgets */
|
2014-11-09 21:20:40 +01:00
|
|
|
UI_region_handlers_add(handlers);
|
2008-12-10 13:56:54 +00:00
|
|
|
}
|
2012-03-24 06:38:07 +00:00
|
|
|
if (flag & ED_KEYMAP_VIEW2D) {
|
2009-11-27 06:24:09 +00:00
|
|
|
/* 2d-viewport handling+manipulation */
|
2012-03-24 02:51:46 +00:00
|
|
|
wmKeyMap *keymap = WM_keymap_find(wm->defaultconf, "View2D", 0, 0);
|
2008-12-10 13:56:54 +00:00
|
|
|
WM_event_add_keymap_handler(handlers, keymap);
|
|
|
|
}
|
2012-03-24 06:38:07 +00:00
|
|
|
if (flag & ED_KEYMAP_MARKERS) {
|
2009-11-27 06:24:09 +00:00
|
|
|
/* time-markers */
|
2012-03-24 02:51:46 +00:00
|
|
|
wmKeyMap *keymap = WM_keymap_find(wm->defaultconf, "Markers", 0, 0);
|
2011-03-07 18:05:41 +00:00
|
|
|
|
|
|
|
/* time space only has this keymap, the others get a boundbox restricted map */
|
2012-05-08 15:43:59 +00:00
|
|
|
if (sa->spacetype != SPACE_TIME) {
|
2011-03-07 18:05:41 +00:00
|
|
|
ARegion *ar;
|
2014-08-12 05:43:24 +10:00
|
|
|
/* same local check for all areas */
|
|
|
|
static rcti rect = {0, 10000, 0, -1};
|
2014-10-28 18:51:28 +01:00
|
|
|
rect.ymax = UI_MARKER_MARGIN_Y;
|
2012-05-08 15:43:59 +00:00
|
|
|
ar = BKE_area_find_region_type(sa, RGN_TYPE_WINDOW);
|
2012-03-24 06:38:07 +00:00
|
|
|
if (ar) {
|
2011-03-07 18:05:41 +00:00
|
|
|
WM_event_add_keymap_handler_bb(handlers, keymap, &rect, &ar->winrct);
|
2011-05-20 05:27:31 +00:00
|
|
|
}
|
2011-03-07 18:05:41 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
WM_event_add_keymap_handler(handlers, keymap);
|
2008-12-10 13:56:54 +00:00
|
|
|
}
|
2012-03-24 06:38:07 +00:00
|
|
|
if (flag & ED_KEYMAP_ANIMATION) {
|
2009-11-27 06:24:09 +00:00
|
|
|
/* frame changing and timeline operators (for time spaces) */
|
2012-03-24 02:51:46 +00:00
|
|
|
wmKeyMap *keymap = WM_keymap_find(wm->defaultconf, "Animation", 0, 0);
|
2008-12-21 08:02:24 +00:00
|
|
|
WM_event_add_keymap_handler(handlers, keymap);
|
|
|
|
}
|
2012-03-24 06:38:07 +00:00
|
|
|
if (flag & ED_KEYMAP_FRAMES) {
|
2009-11-27 06:24:09 +00:00
|
|
|
/* frame changing/jumping (for all spaces) */
|
2012-03-24 02:51:46 +00:00
|
|
|
wmKeyMap *keymap = WM_keymap_find(wm->defaultconf, "Frames", 0, 0);
|
2009-01-23 14:43:25 +00:00
|
|
|
WM_event_add_keymap_handler(handlers, keymap);
|
|
|
|
}
|
2012-03-24 06:38:07 +00:00
|
|
|
if (flag & ED_KEYMAP_GPENCIL) {
|
2009-11-27 06:24:09 +00:00
|
|
|
/* grease pencil */
|
Grease Pencil - Storyboarding Features (merge from GPencil_EditStrokes branch)
This merge-commit brings in a number of new features and workflow/UI improvements for
working with Grease Pencil. While these were originally targetted at improving
the workflow for creating 3D storyboards in Blender using the Grease Pencil,
many of these changes should also prove useful in other workflows too.
The main highlights here are:
1) It is now possible to edit Grease Pencil strokes
- Use D Tab, or toggle the "Enable Editing" toggles in the Toolbar/Properties regions
to enter "Stroke Edit Mode". In this mode, many common editing tools will
operate on Grease Pencil stroke points instead.
- Tools implemented include Select, Select All/Border/Circle/Linked/More/Less,
Grab, Rotate, Scale, Bend, Shear, To Sphere, Mirror, Duplicate, Delete.
- Proportional Editing works when using the transform tools
2) Grease Pencil stroke settings can now be animated
NOTE: Currently drivers don't work, but if time allows, this may still be
added before the release.
3) Strokes can be drawn with "filled" interiors, using a separate set of
colour/opacity settings to the ones used for the lines themselves.
This makes use of OpenGL filled polys, which has the limitation of only
being able to fill convex shapes. Some artifacts may be visible on concave
shapes (e.g. pacman's mouth will be overdrawn)
4) "Volumetric Strokes" - An alternative drawing technique for stroke drawing
has been added which draws strokes as a series of screen-aligned discs.
While this was originally a partial experimental technique at getting better
quality 3D lines, the effects possible using this technique were interesting
enough to warrant making this a dedicated feature. Best results when partial
opacity and large stroke widths are used.
5) Improved Onion Skinning Support
- Different colours can be selected for the before/after ghosts. To do so,
enable the "colour wheel" toggle beside the Onion Skinning toggle, and set
the colours accordingly.
- Different numbers of ghosts can be shown before/after the current frame
6) Grease Pencil datablocks are now attached to the scene by default instead of
the active object.
- For a long time, the object-attachment has proved to be quite problematic
for users to keep track of. Now that this is done at scene level, it is
easier for most users to use.
- An exception for old files (and for any addons which may benefit from object
attachment instead), is that if the active object has a Grease Pencil datablock,
that will be used instead.
- It is not currently possible to choose object-attachment from the UI, but
it is simple to do this from the console instead, by doing:
context.active_object.grease_pencil = bpy.data.grease_pencil["blah"]
7) Various UI Cleanups
- The layers UI has been cleaned up to use a list instead of the nested-panels
design. Apart from saving space, this is also much nicer to look at now.
- The UI code is now all defined in Python. To support this, it has been necessary
to add some new context properties to make it easier to access these settings.
e.g. "gpencil_data" for the datablock
"active_gpencil_layer" and "active_gpencil_frame" for active data,
"editable_gpencil_strokes" for the strokes that can be edited
- The "stroke placement/alignment" settings (previously "Drawing Settings" at the
bottom of the Grease Pencil panel in the Properties Region) is now located in
the toolbar. These were more toolsettings than properties for how GPencil got drawn.
- "Use Sketching Sessions" has been renamed "Continuous Drawing", as per a
suggestion for an earlier discussion on developer.blender.org
- By default, the painting operator will wait for a mouse button to be pressed
before it starts creating the stroke. This is to make it easier to include
this operator in various toolbars/menus/etc. To get it immediately starting
(as when you hold down DKEy to draw), set "wait_for_input" to False.
- GPencil Layers can be rearranged in the "Grease Pencil" mode of the Action Editor
- Toolbar panels have been added to all the other editors which support these.
8) Pie menus for quick-access to tools
A set of experimental pie menus has been included for quick access to many
tools and settings. It is not necessary to use these to get things done,
but they have been designed to help make certain common tasks easier.
- Ctrl-D = The main pie menu. Reveals tools in a context sensitive and
spatially stable manner.
- D Q = "Quick Settings" pie. This allows quick access to the active
layer's settings. Notably, colours, thickness, and turning
onion skinning on/off.
2014-12-01 01:52:06 +13:00
|
|
|
/* NOTE: This is now 2 keymaps - One for basic functionality,
|
|
|
|
* and one that only applies when "Edit Mode" is enabled
|
|
|
|
* for strokes.
|
|
|
|
*
|
|
|
|
* For now, it's easier to just include both,
|
|
|
|
* since you hardly want one without the other.
|
|
|
|
*/
|
|
|
|
wmKeyMap *keymap_general = WM_keymap_find(wm->defaultconf, "Grease Pencil", 0, 0);
|
|
|
|
wmKeyMap *keymap_edit = WM_keymap_find(wm->defaultconf, "Grease Pencil Stroke Edit Mode", 0, 0);
|
|
|
|
|
|
|
|
WM_event_add_keymap_handler(handlers, keymap_general);
|
|
|
|
WM_event_add_keymap_handler(handlers, keymap_edit);
|
2009-08-30 13:32:08 +00:00
|
|
|
}
|
2012-03-24 06:38:07 +00:00
|
|
|
if (flag & ED_KEYMAP_HEADER) {
|
2009-11-27 06:24:09 +00:00
|
|
|
/* standard keymap for headers regions */
|
2012-03-24 02:51:46 +00:00
|
|
|
wmKeyMap *keymap = WM_keymap_find(wm->defaultconf, "Header", 0, 0);
|
2009-11-27 06:24:09 +00:00
|
|
|
WM_event_add_keymap_handler(handlers, keymap);
|
|
|
|
}
|
2008-12-10 13:56:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* called in screen_refresh, or screens_init, also area size changes */
|
2008-01-07 18:03:41 +00:00
|
|
|
void ED_area_initialize(wmWindowManager *wm, wmWindow *win, ScrArea *sa)
|
|
|
|
{
|
|
|
|
ARegion *ar;
|
|
|
|
rcti rect;
|
|
|
|
|
|
|
|
/* set typedefinitions */
|
2012-05-08 15:43:59 +00:00
|
|
|
sa->type = BKE_spacetype_from_id(sa->spacetype);
|
2008-12-10 13:56:54 +00:00
|
|
|
|
2012-05-08 15:43:59 +00:00
|
|
|
if (sa->type == NULL) {
|
|
|
|
sa->butspacetype = sa->spacetype = SPACE_VIEW3D;
|
|
|
|
sa->type = BKE_spacetype_from_id(sa->spacetype);
|
2008-01-07 18:03:41 +00:00
|
|
|
}
|
|
|
|
|
2012-05-08 15:43:59 +00:00
|
|
|
for (ar = sa->regionbase.first; ar; ar = ar->next)
|
|
|
|
ar->type = BKE_regiontype_from_id(sa->type, ar->regiontype);
|
2008-01-07 18:03:41 +00:00
|
|
|
|
2008-12-10 13:56:54 +00:00
|
|
|
/* area sizes */
|
Holiday coding log :)
Nice formatted version (pictures soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.66/Usability
Short list of main changes:
- Transparent region option (over main region), added code to blend in/out such panels.
- Min size window now 640 x 480
- Fixed DPI for ui - lots of cleanup and changes everywhere. Icon image need correct size still, layer-in-use icon needs remake.
- Macbook retina support, use command line --no-native-pixels to disable it
- Timeline Marker label was drawing wrong
- Trackpad and magic mouse: supports zoom (hold ctrl)
- Fix for splash position: removed ghost function and made window size update after creation immediate
- Fast undo buffer save now adds UI as well. Could be checked for regular file save even...
Quit.blend and temp file saving use this now.
- Dixed filename in window on reading quit.blend or temp saves, and they now add a warning in window title: "(Recovered)"
- New Userpref option "Keep Session" - this always saves quit.blend, and loads on start.
This allows keeping UI and data without actual saves, until you actually save.
When you load startup.blend and quit, it recognises the quit.blend as a startup (no file name in header)
- Added 3D view copy/paste buffers (selected objects). Shortcuts ctrl-c, ctrl-v (OSX, cmd-c, cmd-v).
Coded partial file saving for it. Could be used for other purposes. Todo: use OS clipboards.
- User preferences (themes, keymaps, user settings) now can be saved as a separate file.
Old option is called "Save Startup File" the new one "Save User Settings".
To visualise this difference, the 'save startup file' button has been removed from user preferences window. That option is available as CTRL+U and in File menu still.
- OSX: fixed bug that stopped giving mouse events outside window.
This also fixes "Continuous Grab" for OSX. (error since 2009)
2012-12-12 18:58:11 +00:00
|
|
|
area_calc_totrct(sa, WM_window_pixels_x(win), WM_window_pixels_y(win));
|
2008-01-07 18:03:41 +00:00
|
|
|
|
2.5
First version of region-scaling. WIP commit, so bear with me a while!
- All fixed sized regions have a small 'drag' widget, on the left or top.
(not yet for free-sized regions, like 4-split).
- Mouse-over on widget changes cursor and allows drag.
- Click on widget hides/reveals.
- Fun for test; 3d view header, if high enough, draws more rows of
buttons when width is too small.
The WIP stuff;
- It doesn't save yet in files, using the "minsize" variable of region
definitions, also means other similar areas show same sizes now.
- Definitions for pref size, min/max will be added.
- Properties panel in Fcurve window draws widget on wrong place when
hidden (subdiv system needs tweak)
- Widgets don't draw perfect yet, also needs further tweaks.
But, in general it's quite fun and usable. :) Many variatians are possible,
like for real tabs, or little icons, or just click-drag on edge.
The reason to first try the widget/tab variation:
- it re-uses the "Area Action Zone" code, widgets for layouting Screens
- it's visible, hotkey-only options for screen layouts are not preferred.
- distinguish clearly area-edges from region-edges this way. Having the
cursor change shape on every edge (and block input) is probably annoying
too... but that can be tested.
Later more!
2009-05-24 13:29:29 +00:00
|
|
|
/* clear all azones, add the area triange widgets */
|
2014-02-27 23:39:40 +01:00
|
|
|
area_azone_initialize(win, win->screen, sa);
|
2.5
First version of region-scaling. WIP commit, so bear with me a while!
- All fixed sized regions have a small 'drag' widget, on the left or top.
(not yet for free-sized regions, like 4-split).
- Mouse-over on widget changes cursor and allows drag.
- Click on widget hides/reveals.
- Fun for test; 3d view header, if high enough, draws more rows of
buttons when width is too small.
The WIP stuff;
- It doesn't save yet in files, using the "minsize" variable of region
definitions, also means other similar areas show same sizes now.
- Definitions for pref size, min/max will be added.
- Properties panel in Fcurve window draws widget on wrong place when
hidden (subdiv system needs tweak)
- Widgets don't draw perfect yet, also needs further tweaks.
But, in general it's quite fun and usable. :) Many variatians are possible,
like for real tabs, or little icons, or just click-drag on edge.
The reason to first try the widget/tab variation:
- it re-uses the "Area Action Zone" code, widgets for layouting Screens
- it's visible, hotkey-only options for screen layouts are not preferred.
- distinguish clearly area-edges from region-edges this way. Having the
cursor change shape on every edge (and block input) is probably annoying
too... but that can be tested.
Later more!
2009-05-24 13:29:29 +00:00
|
|
|
|
2008-01-07 18:03:41 +00:00
|
|
|
/* region rect sizes */
|
2012-05-08 15:43:59 +00:00
|
|
|
rect = sa->totrct;
|
Holiday coding log :)
Nice formatted version (pictures soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.66/Usability
Short list of main changes:
- Transparent region option (over main region), added code to blend in/out such panels.
- Min size window now 640 x 480
- Fixed DPI for ui - lots of cleanup and changes everywhere. Icon image need correct size still, layer-in-use icon needs remake.
- Macbook retina support, use command line --no-native-pixels to disable it
- Timeline Marker label was drawing wrong
- Trackpad and magic mouse: supports zoom (hold ctrl)
- Fix for splash position: removed ghost function and made window size update after creation immediate
- Fast undo buffer save now adds UI as well. Could be checked for regular file save even...
Quit.blend and temp file saving use this now.
- Dixed filename in window on reading quit.blend or temp saves, and they now add a warning in window title: "(Recovered)"
- New Userpref option "Keep Session" - this always saves quit.blend, and loads on start.
This allows keeping UI and data without actual saves, until you actually save.
When you load startup.blend and quit, it recognises the quit.blend as a startup (no file name in header)
- Added 3D view copy/paste buffers (selected objects). Shortcuts ctrl-c, ctrl-v (OSX, cmd-c, cmd-v).
Coded partial file saving for it. Could be used for other purposes. Todo: use OS clipboards.
- User preferences (themes, keymaps, user settings) now can be saved as a separate file.
Old option is called "Save Startup File" the new one "Save User Settings".
To visualise this difference, the 'save startup file' button has been removed from user preferences window. That option is available as CTRL+U and in File menu still.
- OSX: fixed bug that stopped giving mouse events outside window.
This also fixes "Continuous Grab" for OSX. (error since 2009)
2012-12-12 18:58:11 +00:00
|
|
|
region_rect_recursive(win, sa, sa->regionbase.first, &rect, 0);
|
2008-01-07 18:03:41 +00:00
|
|
|
|
2010-04-09 13:16:17 +00:00
|
|
|
/* default area handlers */
|
2011-03-07 18:05:41 +00:00
|
|
|
ed_default_handlers(wm, sa, &sa->handlers, sa->type->keymapflag);
|
2008-12-10 13:56:54 +00:00
|
|
|
/* checks spacedata, adds own handlers */
|
2012-03-24 06:38:07 +00:00
|
|
|
if (sa->type->init)
|
2008-12-10 13:56:54 +00:00
|
|
|
sa->type->init(wm, sa);
|
2008-01-17 05:33:54 +00:00
|
|
|
|
2008-12-10 13:56:54 +00:00
|
|
|
/* region windows, default and own handlers */
|
2012-05-08 15:43:59 +00:00
|
|
|
for (ar = sa->regionbase.first; ar; ar = ar->next) {
|
2010-10-14 12:24:08 +00:00
|
|
|
region_subwindow(win, ar);
|
2008-12-10 13:56:54 +00:00
|
|
|
|
2012-03-24 06:38:07 +00:00
|
|
|
if (ar->swinid) {
|
2010-04-09 13:16:17 +00:00
|
|
|
/* default region handlers */
|
2011-03-07 18:05:41 +00:00
|
|
|
ed_default_handlers(wm, sa, &ar->handlers, ar->type->keymapflag);
|
2010-04-08 16:36:50 +00:00
|
|
|
/* own handlers */
|
2012-03-24 06:38:07 +00:00
|
|
|
if (ar->type->init)
|
2009-02-17 15:53:52 +00:00
|
|
|
ar->type->init(wm, ar);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
/* prevent uiblocks to run */
|
2014-11-09 21:20:40 +01:00
|
|
|
UI_blocklist_free(NULL, &ar->uiblocks);
|
2009-02-17 15:53:52 +00:00
|
|
|
}
|
2008-12-10 13:56:54 +00:00
|
|
|
}
|
2008-01-07 18:03:41 +00:00
|
|
|
}
|
|
|
|
|
2014-04-02 18:42:08 +11:00
|
|
|
static void region_update_rect(ARegion *ar)
|
|
|
|
{
|
|
|
|
ar->winx = BLI_rcti_size_x(&ar->winrct) + 1;
|
|
|
|
ar->winy = BLI_rcti_size_y(&ar->winrct) + 1;
|
|
|
|
|
|
|
|
/* v2d mask is used to subtract scrollbars from a 2d view. Needs initialize here. */
|
|
|
|
BLI_rcti_init(&ar->v2d.mask, 0, ar->winx - 1, 0, ar->winy -1);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Call to move a popup window (keep OpenGL context free!)
|
|
|
|
*/
|
|
|
|
void ED_region_update_rect(bContext *C, ARegion *ar)
|
|
|
|
{
|
|
|
|
wmWindow *win = CTX_wm_window(C);
|
|
|
|
|
|
|
|
wm_subwindow_rect_set(win, ar->swinid, &ar->winrct);
|
|
|
|
|
|
|
|
region_update_rect(ar);
|
|
|
|
}
|
|
|
|
|
2008-12-10 13:56:54 +00:00
|
|
|
/* externally called for floating regions like menus */
|
|
|
|
void ED_region_init(bContext *C, ARegion *ar)
|
|
|
|
{
|
2012-10-26 04:14:10 +00:00
|
|
|
// ARegionType *at = ar->type;
|
2008-12-10 13:56:54 +00:00
|
|
|
|
|
|
|
/* refresh can be called before window opened */
|
2010-10-14 12:24:08 +00:00
|
|
|
region_subwindow(CTX_wm_window(C), ar);
|
2008-12-10 13:56:54 +00:00
|
|
|
|
2014-04-02 18:42:08 +11:00
|
|
|
region_update_rect(ar);
|
2008-12-10 13:56:54 +00:00
|
|
|
}
|
|
|
|
|
2012-12-13 12:17:57 +00:00
|
|
|
/* for quick toggle, can skip fades */
|
2014-04-03 09:24:09 +11:00
|
|
|
void region_toggle_hidden(bContext *C, ARegion *ar, const bool do_fade)
|
2009-09-14 19:12:29 +00:00
|
|
|
{
|
2012-05-08 15:43:59 +00:00
|
|
|
ScrArea *sa = CTX_wm_area(C);
|
2012-12-13 12:17:57 +00:00
|
|
|
|
2009-09-14 19:12:29 +00:00
|
|
|
ar->flag ^= RGN_FLAG_HIDDEN;
|
2012-12-13 12:17:57 +00:00
|
|
|
|
|
|
|
if (do_fade && ar->overlap) {
|
Holiday coding log :)
Nice formatted version (pictures soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.66/Usability
Short list of main changes:
- Transparent region option (over main region), added code to blend in/out such panels.
- Min size window now 640 x 480
- Fixed DPI for ui - lots of cleanup and changes everywhere. Icon image need correct size still, layer-in-use icon needs remake.
- Macbook retina support, use command line --no-native-pixels to disable it
- Timeline Marker label was drawing wrong
- Trackpad and magic mouse: supports zoom (hold ctrl)
- Fix for splash position: removed ghost function and made window size update after creation immediate
- Fast undo buffer save now adds UI as well. Could be checked for regular file save even...
Quit.blend and temp file saving use this now.
- Dixed filename in window on reading quit.blend or temp saves, and they now add a warning in window title: "(Recovered)"
- New Userpref option "Keep Session" - this always saves quit.blend, and loads on start.
This allows keeping UI and data without actual saves, until you actually save.
When you load startup.blend and quit, it recognises the quit.blend as a startup (no file name in header)
- Added 3D view copy/paste buffers (selected objects). Shortcuts ctrl-c, ctrl-v (OSX, cmd-c, cmd-v).
Coded partial file saving for it. Could be used for other purposes. Todo: use OS clipboards.
- User preferences (themes, keymaps, user settings) now can be saved as a separate file.
Old option is called "Save Startup File" the new one "Save User Settings".
To visualise this difference, the 'save startup file' button has been removed from user preferences window. That option is available as CTRL+U and in File menu still.
- OSX: fixed bug that stopped giving mouse events outside window.
This also fixes "Continuous Grab" for OSX. (error since 2009)
2012-12-12 18:58:11 +00:00
|
|
|
/* starts a timer, and in end calls the stuff below itself (region_sblend_invoke()) */
|
|
|
|
region_blend_start(C, sa, ar);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
if (ar->flag & RGN_FLAG_HIDDEN)
|
|
|
|
WM_event_remove_handlers(C, &ar->handlers);
|
2012-12-13 12:17:57 +00:00
|
|
|
|
Holiday coding log :)
Nice formatted version (pictures soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.66/Usability
Short list of main changes:
- Transparent region option (over main region), added code to blend in/out such panels.
- Min size window now 640 x 480
- Fixed DPI for ui - lots of cleanup and changes everywhere. Icon image need correct size still, layer-in-use icon needs remake.
- Macbook retina support, use command line --no-native-pixels to disable it
- Timeline Marker label was drawing wrong
- Trackpad and magic mouse: supports zoom (hold ctrl)
- Fix for splash position: removed ghost function and made window size update after creation immediate
- Fast undo buffer save now adds UI as well. Could be checked for regular file save even...
Quit.blend and temp file saving use this now.
- Dixed filename in window on reading quit.blend or temp saves, and they now add a warning in window title: "(Recovered)"
- New Userpref option "Keep Session" - this always saves quit.blend, and loads on start.
This allows keeping UI and data without actual saves, until you actually save.
When you load startup.blend and quit, it recognises the quit.blend as a startup (no file name in header)
- Added 3D view copy/paste buffers (selected objects). Shortcuts ctrl-c, ctrl-v (OSX, cmd-c, cmd-v).
Coded partial file saving for it. Could be used for other purposes. Todo: use OS clipboards.
- User preferences (themes, keymaps, user settings) now can be saved as a separate file.
Old option is called "Save Startup File" the new one "Save User Settings".
To visualise this difference, the 'save startup file' button has been removed from user preferences window. That option is available as CTRL+U and in File menu still.
- OSX: fixed bug that stopped giving mouse events outside window.
This also fixes "Continuous Grab" for OSX. (error since 2009)
2012-12-12 18:58:11 +00:00
|
|
|
ED_area_initialize(CTX_wm_manager(C), CTX_wm_window(C), sa);
|
|
|
|
ED_area_tag_redraw(sa);
|
|
|
|
}
|
2009-09-14 19:12:29 +00:00
|
|
|
}
|
2008-12-09 15:59:43 +00:00
|
|
|
|
2012-12-13 12:17:57 +00:00
|
|
|
/* exported to all editors, uses fading default */
|
|
|
|
void ED_region_toggle_hidden(bContext *C, ARegion *ar)
|
|
|
|
{
|
2015-02-11 00:09:45 +01:00
|
|
|
region_toggle_hidden(C, ar, true);
|
2012-12-13 12:17:57 +00:00
|
|
|
}
|
|
|
|
|
2014-04-11 09:17:43 +10:00
|
|
|
/**
|
|
|
|
* we swap spaces for fullscreen to keep all allocated data area vertices were set
|
|
|
|
*/
|
2014-04-11 17:16:51 +10:00
|
|
|
void ED_area_data_copy(ScrArea *sa_dst, ScrArea *sa_src, const bool do_free)
|
2008-01-07 18:03:41 +00:00
|
|
|
{
|
2009-01-19 18:50:35 +00:00
|
|
|
SpaceType *st;
|
2008-01-07 18:03:41 +00:00
|
|
|
ARegion *ar;
|
2014-04-11 17:16:51 +10:00
|
|
|
const char spacetype = sa_dst->spacetype;
|
2014-05-17 00:28:00 +10:00
|
|
|
const short flag_copy = HEADER_NO_PULLDOWN;
|
2008-01-07 18:03:41 +00:00
|
|
|
|
2014-04-11 17:16:51 +10:00
|
|
|
sa_dst->headertype = sa_src->headertype;
|
|
|
|
sa_dst->spacetype = sa_src->spacetype;
|
|
|
|
sa_dst->type = sa_src->type;
|
|
|
|
sa_dst->butspacetype = sa_src->butspacetype;
|
|
|
|
|
2014-05-17 00:28:00 +10:00
|
|
|
sa_dst->flag = (sa_dst->flag & ~flag_copy) | (sa_src->flag & flag_copy);
|
|
|
|
|
2014-04-11 17:16:51 +10:00
|
|
|
/* area */
|
|
|
|
if (do_free) {
|
|
|
|
BKE_spacedata_freelist(&sa_dst->spacedata);
|
2009-03-11 20:22:06 +00:00
|
|
|
}
|
2014-04-11 17:16:51 +10:00
|
|
|
BKE_spacedata_copylist(&sa_dst->spacedata, &sa_src->spacedata);
|
|
|
|
|
2009-02-08 12:16:35 +00:00
|
|
|
/* Note; SPACE_EMPTY is possible on new screens */
|
2014-04-11 17:16:51 +10:00
|
|
|
|
2.5
View3D has been split now in a local part (RegionView3D) and a
per-area part (old View3D). Currently local is:
- view transform
- camera zoom/offset
- gpencil (todo)
- custom clipping planes
Rest is in Area still, like active camera, draw type, layers,
localview, custom centers, around-settings, transform widget,
gridlines, and so on (mostly stuff as available in header).
To see it work; also added new feature for region split,
press SHIFT+ALT+CTRL+S for four-split.
The idea is to make a preset 4-split, configured to stick
to top/right/front views for three views.
Another cool idea to explore is to then box-clip all drawing
based on these 3 views.
Note about the code:
- currently view3d still stores some depricated settings, to
convert from older files. Not all settings are copied over
though, like custom clip planes or the 'lock view to object'.
- since some view3d ops are now on area level, the operators
for it should keep track of that.
Bugfix in transform: quat initialize in operator-invoke missed
one zero.
Als brought back GE to compile for missing Ipos and channels.
2009-01-19 16:54:41 +00:00
|
|
|
/* regions */
|
2014-04-11 17:16:51 +10:00
|
|
|
if (do_free) {
|
2014-04-11 09:17:43 +10:00
|
|
|
st = BKE_spacetype_from_id(spacetype);
|
2014-04-11 17:16:51 +10:00
|
|
|
for (ar = sa_dst->regionbase.first; ar; ar = ar->next)
|
2014-04-11 09:17:43 +10:00
|
|
|
BKE_area_region_free(st, ar);
|
2014-04-11 17:16:51 +10:00
|
|
|
BLI_freelistN(&sa_dst->regionbase);
|
2014-04-11 09:17:43 +10:00
|
|
|
}
|
2014-04-11 17:16:51 +10:00
|
|
|
st = BKE_spacetype_from_id(sa_src->spacetype);
|
|
|
|
for (ar = sa_src->regionbase.first; ar; ar = ar->next) {
|
|
|
|
ARegion *newar = BKE_area_region_copy(st, ar);
|
|
|
|
BLI_addtail(&sa_dst->regionbase, newar);
|
2009-03-11 20:22:06 +00:00
|
|
|
}
|
2014-04-11 17:16:51 +10:00
|
|
|
}
|
2014-04-11 09:17:43 +10:00
|
|
|
|
2014-04-11 17:16:51 +10:00
|
|
|
void ED_area_data_swap(ScrArea *sa_dst, ScrArea *sa_src)
|
|
|
|
{
|
2015-02-23 20:02:54 +11:00
|
|
|
SWAP(short, sa_dst->headertype, sa_src->headertype);
|
|
|
|
SWAP(char, sa_dst->spacetype, sa_src->spacetype);
|
|
|
|
SWAP(SpaceType *, sa_dst->type, sa_src->type);
|
|
|
|
SWAP(char, sa_dst->butspacetype, sa_src->butspacetype);
|
2014-04-11 17:16:51 +10:00
|
|
|
|
|
|
|
|
|
|
|
SWAP(ListBase, sa_dst->spacedata, sa_src->spacedata);
|
|
|
|
SWAP(ListBase, sa_dst->regionbase, sa_src->regionbase);
|
2008-01-07 18:03:41 +00:00
|
|
|
}
|
|
|
|
|
2009-01-06 18:14:37 +00:00
|
|
|
/* *********** Space switching code *********** */
|
2008-12-14 12:16:55 +00:00
|
|
|
|
2009-03-11 20:22:06 +00:00
|
|
|
void ED_area_swapspace(bContext *C, ScrArea *sa1, ScrArea *sa2)
|
|
|
|
{
|
2012-05-08 15:43:59 +00:00
|
|
|
ScrArea *tmp = MEM_callocN(sizeof(ScrArea), "addscrarea");
|
2009-03-11 20:22:06 +00:00
|
|
|
|
|
|
|
ED_area_exit(C, sa1);
|
|
|
|
ED_area_exit(C, sa2);
|
|
|
|
|
2014-04-11 17:16:51 +10:00
|
|
|
ED_area_data_copy(tmp, sa1, false);
|
|
|
|
ED_area_data_copy(sa1, sa2, true);
|
|
|
|
ED_area_data_copy(sa2, tmp, true);
|
2009-03-11 20:22:06 +00:00
|
|
|
ED_area_initialize(CTX_wm_manager(C), CTX_wm_window(C), sa1);
|
|
|
|
ED_area_initialize(CTX_wm_manager(C), CTX_wm_window(C), sa2);
|
|
|
|
|
|
|
|
BKE_screen_area_free(tmp);
|
|
|
|
MEM_freeN(tmp);
|
|
|
|
|
|
|
|
/* tell WM to refresh, cursor types etc */
|
|
|
|
WM_event_add_mousemove(C);
|
|
|
|
|
|
|
|
ED_area_tag_redraw(sa1);
|
|
|
|
ED_area_tag_refresh(sa1);
|
|
|
|
ED_area_tag_redraw(sa2);
|
|
|
|
ED_area_tag_refresh(sa2);
|
|
|
|
}
|
|
|
|
|
2009-01-06 18:14:37 +00:00
|
|
|
void ED_area_newspace(bContext *C, ScrArea *sa, int type)
|
2008-12-12 10:18:26 +00:00
|
|
|
{
|
2012-03-24 06:38:07 +00:00
|
|
|
if (sa->spacetype != type) {
|
2008-12-14 13:59:34 +00:00
|
|
|
SpaceType *st;
|
|
|
|
SpaceLink *slold;
|
2008-12-12 10:18:26 +00:00
|
|
|
SpaceLink *sl;
|
2008-12-14 13:59:34 +00:00
|
|
|
|
|
|
|
ED_area_exit(C, sa);
|
|
|
|
|
2012-05-08 15:43:59 +00:00
|
|
|
st = BKE_spacetype_from_id(type);
|
|
|
|
slold = sa->spacedata.first;
|
2008-12-14 13:59:34 +00:00
|
|
|
|
2012-05-08 15:43:59 +00:00
|
|
|
sa->spacetype = type;
|
|
|
|
sa->butspacetype = type;
|
|
|
|
sa->type = st;
|
2008-12-12 10:18:26 +00:00
|
|
|
|
|
|
|
/* check previously stored space */
|
2012-05-08 15:43:59 +00:00
|
|
|
for (sl = sa->spacedata.first; sl; sl = sl->next)
|
|
|
|
if (sl->spacetype == type)
|
2008-12-12 10:18:26 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
/* old spacedata... happened during work on 2.50, remove */
|
2014-02-08 06:07:10 +11:00
|
|
|
if (sl && BLI_listbase_is_empty(&sl->regionbase)) {
|
2008-12-12 10:18:26 +00:00
|
|
|
st->free(sl);
|
2008-12-23 01:08:02 +00:00
|
|
|
BLI_freelinkN(&sa->spacedata, sl);
|
2012-03-24 06:38:07 +00:00
|
|
|
if (slold == sl) {
|
2012-05-08 15:43:59 +00:00
|
|
|
slold = NULL;
|
2011-03-31 04:55:57 +00:00
|
|
|
}
|
2012-05-08 15:43:59 +00:00
|
|
|
sl = NULL;
|
2008-12-12 10:18:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (sl) {
|
|
|
|
/* swap regions */
|
2012-05-08 15:43:59 +00:00
|
|
|
slold->regionbase = sa->regionbase;
|
|
|
|
sa->regionbase = sl->regionbase;
|
2014-02-08 06:07:10 +11:00
|
|
|
BLI_listbase_clear(&sl->regionbase);
|
2008-12-12 10:18:26 +00:00
|
|
|
|
|
|
|
/* put in front of list */
|
|
|
|
BLI_remlink(&sa->spacedata, sl);
|
|
|
|
BLI_addhead(&sa->spacedata, sl);
|
2012-10-21 05:46:41 +00:00
|
|
|
}
|
2008-12-12 10:18:26 +00:00
|
|
|
else {
|
|
|
|
/* new space */
|
2012-03-24 06:38:07 +00:00
|
|
|
if (st) {
|
2012-05-08 15:43:59 +00:00
|
|
|
sl = st->new(C);
|
2008-12-12 10:18:26 +00:00
|
|
|
BLI_addhead(&sa->spacedata, sl);
|
|
|
|
|
|
|
|
/* swap regions */
|
2012-03-24 06:38:07 +00:00
|
|
|
if (slold)
|
2012-05-08 15:43:59 +00:00
|
|
|
slold->regionbase = sa->regionbase;
|
|
|
|
sa->regionbase = sl->regionbase;
|
2014-02-08 06:07:10 +11:00
|
|
|
BLI_listbase_clear(&sl->regionbase);
|
2008-12-12 10:18:26 +00:00
|
|
|
}
|
|
|
|
}
|
2008-12-12 16:29:33 +00:00
|
|
|
|
2008-12-18 02:56:48 +00:00
|
|
|
ED_area_initialize(CTX_wm_manager(C), CTX_wm_window(C), sa);
|
2008-12-16 12:28:00 +00:00
|
|
|
|
2008-12-15 18:43:18 +00:00
|
|
|
/* tell WM to refresh, cursor types etc */
|
|
|
|
WM_event_add_mousemove(C);
|
Added a new notifyer, NC_SPACE_CHANGED, to signal an editor that
replaces another so it can do updates (e.g. dopesheet editor can
sync channel selection).
Also coded a simple optimization for allocating small objects,
based on mempools. It's #ifdef'd out, you can enabled it by
defining OPTIMIZE_SMALL_BLOCKS (e.g. adding -DDOPTIMIZE_SMALL_BLOCKS to
your compiler flags).
We suffer from a great deal of performance loss from the system allocator
(vgroups, ghash, edgehash, the singly-linked list implementation in blenlib,
editmesh, and likely a great many areas I'm forgetting), and this is the
common solution for handling the many-small-objects problem. It's not
really production-ready yet (it's long-term memory consequencers need to
be profiled first, and the implementation tweaked as necassary), but for
people on systems with slow system allocators it's worth trying.
Note that since this creates a guardedalloc<->blenlib link, the build systems
need to be updated accordingly (I've already done this for scons, though I'm
not sure if the player builds).
2010-01-21 03:08:57 +00:00
|
|
|
|
2012-08-17 14:43:20 +00:00
|
|
|
/* send space change notifier */
|
2012-05-08 15:43:59 +00:00
|
|
|
WM_event_add_notifier(C, NC_SPACE | ND_SPACE_CHANGED, sa);
|
2011-01-04 14:37:21 +00:00
|
|
|
|
2009-02-19 16:22:07 +00:00
|
|
|
ED_area_tag_refresh(sa);
|
2008-12-12 10:18:26 +00:00
|
|
|
}
|
2011-01-04 14:37:21 +00:00
|
|
|
|
|
|
|
/* also redraw when re-used */
|
|
|
|
ED_area_tag_redraw(sa);
|
2008-12-12 10:18:26 +00:00
|
|
|
}
|
|
|
|
|
2009-12-08 07:12:06 +00:00
|
|
|
void ED_area_prevspace(bContext *C, ScrArea *sa)
|
2009-01-06 14:42:54 +00:00
|
|
|
{
|
2015-02-23 21:06:55 +11:00
|
|
|
SpaceLink *sl = sa->spacedata.first;
|
2009-01-06 14:42:54 +00:00
|
|
|
|
Holiday coding log :)
Nice formatted version (pictures soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.66/Usability
Short list of main changes:
- Transparent region option (over main region), added code to blend in/out such panels.
- Min size window now 640 x 480
- Fixed DPI for ui - lots of cleanup and changes everywhere. Icon image need correct size still, layer-in-use icon needs remake.
- Macbook retina support, use command line --no-native-pixels to disable it
- Timeline Marker label was drawing wrong
- Trackpad and magic mouse: supports zoom (hold ctrl)
- Fix for splash position: removed ghost function and made window size update after creation immediate
- Fast undo buffer save now adds UI as well. Could be checked for regular file save even...
Quit.blend and temp file saving use this now.
- Dixed filename in window on reading quit.blend or temp saves, and they now add a warning in window title: "(Recovered)"
- New Userpref option "Keep Session" - this always saves quit.blend, and loads on start.
This allows keeping UI and data without actual saves, until you actually save.
When you load startup.blend and quit, it recognises the quit.blend as a startup (no file name in header)
- Added 3D view copy/paste buffers (selected objects). Shortcuts ctrl-c, ctrl-v (OSX, cmd-c, cmd-v).
Coded partial file saving for it. Could be used for other purposes. Todo: use OS clipboards.
- User preferences (themes, keymaps, user settings) now can be saved as a separate file.
Old option is called "Save Startup File" the new one "Save User Settings".
To visualise this difference, the 'save startup file' button has been removed from user preferences window. That option is available as CTRL+U and in File menu still.
- OSX: fixed bug that stopped giving mouse events outside window.
This also fixes "Continuous Grab" for OSX. (error since 2009)
2012-12-12 18:58:11 +00:00
|
|
|
if (sl && sl->next) {
|
2009-09-11 20:06:09 +00:00
|
|
|
/* workaround for case of double prevspace, render window
|
2012-03-03 16:31:46 +00:00
|
|
|
* with a file browser on top of it */
|
2012-03-24 06:38:07 +00:00
|
|
|
if (sl->next->spacetype == SPACE_FILE && sl->next->next)
|
2009-09-11 20:06:09 +00:00
|
|
|
ED_area_newspace(C, sa, sl->next->next->spacetype);
|
|
|
|
else
|
|
|
|
ED_area_newspace(C, sa, sl->next->spacetype);
|
2009-01-06 14:42:54 +00:00
|
|
|
}
|
|
|
|
else {
|
2012-10-27 15:27:27 +00:00
|
|
|
/* no change */
|
|
|
|
return;
|
2009-01-06 14:42:54 +00:00
|
|
|
}
|
2015-01-28 02:32:52 +01:00
|
|
|
sa->flag &= ~AREA_FLAG_STACKED_FULLSCREEN;
|
|
|
|
|
2009-01-06 18:14:37 +00:00
|
|
|
ED_area_tag_redraw(sa);
|
Added a new notifyer, NC_SPACE_CHANGED, to signal an editor that
replaces another so it can do updates (e.g. dopesheet editor can
sync channel selection).
Also coded a simple optimization for allocating small objects,
based on mempools. It's #ifdef'd out, you can enabled it by
defining OPTIMIZE_SMALL_BLOCKS (e.g. adding -DDOPTIMIZE_SMALL_BLOCKS to
your compiler flags).
We suffer from a great deal of performance loss from the system allocator
(vgroups, ghash, edgehash, the singly-linked list implementation in blenlib,
editmesh, and likely a great many areas I'm forgetting), and this is the
common solution for handling the many-small-objects problem. It's not
really production-ready yet (it's long-term memory consequencers need to
be profiled first, and the implementation tweaked as necassary), but for
people on systems with slow system allocators it's worth trying.
Note that since this creates a guardedalloc<->blenlib link, the build systems
need to be updated accordingly (I've already done this for scons, though I'm
not sure if the player builds).
2010-01-21 03:08:57 +00:00
|
|
|
|
2012-08-17 14:43:20 +00:00
|
|
|
/* send space change notifier */
|
2012-05-08 15:43:59 +00:00
|
|
|
WM_event_add_notifier(C, NC_SPACE | ND_SPACE_CHANGED, sa);
|
2009-01-06 14:42:54 +00:00
|
|
|
}
|
|
|
|
|
2008-12-14 12:16:55 +00:00
|
|
|
/* returns offset for next button in header */
|
2009-07-23 20:40:51 +00:00
|
|
|
int ED_area_header_switchbutton(const bContext *C, uiBlock *block, int yco)
|
2008-12-14 12:16:55 +00:00
|
|
|
{
|
2012-05-08 15:43:59 +00:00
|
|
|
ScrArea *sa = CTX_wm_area(C);
|
2013-06-09 16:18:23 +00:00
|
|
|
bScreen *scr = CTX_wm_screen(C);
|
|
|
|
PointerRNA areaptr;
|
2012-12-18 20:00:52 +00:00
|
|
|
int xco = 0.4 * U.widget_unit;
|
2013-06-09 16:18:23 +00:00
|
|
|
|
|
|
|
RNA_pointer_create(&(scr->id), &RNA_Area, sa, &areaptr);
|
|
|
|
|
2014-11-09 21:20:40 +01:00
|
|
|
uiDefButR(block, UI_BTYPE_MENU, 0, "", xco, yco, 1.5 * U.widget_unit, U.widget_unit,
|
2013-06-09 16:18:23 +00:00
|
|
|
&areaptr, "type", 0, 0.0f, 0.0f, 0.0f, 0.0f, "");
|
|
|
|
|
2012-12-18 20:00:52 +00:00
|
|
|
return xco + 1.7 * U.widget_unit;
|
2009-07-23 20:40:51 +00:00
|
|
|
}
|
|
|
|
|
UI: Layout Engine
* Buttons are now created first, and after that the layout is computed.
This means the layout engine now works at button level, and makes it
easier to write templates. Otherwise you had to store all info and
create the buttons later.
* Added interface_templates.c as a separate file to put templates in.
These can contain regular buttons, and can be put in a Free layout,
which means you can specify manual coordinates, but still get nested
correct inside other layouts.
* API was changed to allow better nesting. Previously items were added
in the last added layout specifier, i.e. one level up in the layout
hierarchy. This doesn't work well in always, so now when creating things
like rows or columns it always returns a layout which you have to add
the items in. All py scripts were updated to follow this.
* Computing the layout now goes in two passes, first estimating the
required width/height of all nested layouts, and then in the second
pass using the results of that to decide on the actual locations.
* Enum and array buttons now follow the direction of the layout, i.e.
they are vertical or horizontal depending if they are in a column or row.
* Color properties now get a color picker, and only get the additional
RGB sliders with Expand=True.
* File/directory string properties now get a button next to them for
opening the file browse, though this is not implemented yet.
* Layout items can now be aligned, set align=True when creating a column,
row, etc.
* Buttons now get a minimum width of one icon (avoids squashing icon
buttons).
* Moved some more space variables into Style.
2009-05-15 11:19:59 +00:00
|
|
|
/************************ standard UI regions ************************/
|
|
|
|
|
2010-12-03 17:05:21 +00:00
|
|
|
void ED_region_panels(const bContext *C, ARegion *ar, int vertical, const char *context, int contextnr)
|
UI: Layout Engine
* Buttons are now created first, and after that the layout is computed.
This means the layout engine now works at button level, and makes it
easier to write templates. Otherwise you had to store all info and
create the buttons later.
* Added interface_templates.c as a separate file to put templates in.
These can contain regular buttons, and can be put in a Free layout,
which means you can specify manual coordinates, but still get nested
correct inside other layouts.
* API was changed to allow better nesting. Previously items were added
in the last added layout specifier, i.e. one level up in the layout
hierarchy. This doesn't work well in always, so now when creating things
like rows or columns it always returns a layout which you have to add
the items in. All py scripts were updated to follow this.
* Computing the layout now goes in two passes, first estimating the
required width/height of all nested layouts, and then in the second
pass using the results of that to decide on the actual locations.
* Enum and array buttons now follow the direction of the layout, i.e.
they are vertical or horizontal depending if they are in a column or row.
* Color properties now get a color picker, and only get the additional
RGB sliders with Expand=True.
* File/directory string properties now get a button next to them for
opening the file browse, though this is not implemented yet.
* Layout items can now be aligned, set align=True when creating a column,
row, etc.
* Buttons now get a minimum width of one icon (avoids squashing icon
buttons).
* Moved some more space variables into Style.
2009-05-15 11:19:59 +00:00
|
|
|
{
|
2012-05-08 15:43:59 +00:00
|
|
|
ScrArea *sa = CTX_wm_area(C);
|
2014-11-09 21:20:40 +01:00
|
|
|
uiStyle *style = UI_style_get_dpi();
|
UI: Layout Engine
* Buttons are now created first, and after that the layout is computed.
This means the layout engine now works at button level, and makes it
easier to write templates. Otherwise you had to store all info and
create the buttons later.
* Added interface_templates.c as a separate file to put templates in.
These can contain regular buttons, and can be put in a Free layout,
which means you can specify manual coordinates, but still get nested
correct inside other layouts.
* API was changed to allow better nesting. Previously items were added
in the last added layout specifier, i.e. one level up in the layout
hierarchy. This doesn't work well in always, so now when creating things
like rows or columns it always returns a layout which you have to add
the items in. All py scripts were updated to follow this.
* Computing the layout now goes in two passes, first estimating the
required width/height of all nested layouts, and then in the second
pass using the results of that to decide on the actual locations.
* Enum and array buttons now follow the direction of the layout, i.e.
they are vertical or horizontal depending if they are in a column or row.
* Color properties now get a color picker, and only get the additional
RGB sliders with Expand=True.
* File/directory string properties now get a button next to them for
opening the file browse, though this is not implemented yet.
* Layout items can now be aligned, set align=True when creating a column,
row, etc.
* Buttons now get a minimum width of one icon (avoids squashing icon
buttons).
* Moved some more space variables into Style.
2009-05-15 11:19:59 +00:00
|
|
|
uiBlock *block;
|
|
|
|
PanelType *pt;
|
|
|
|
Panel *panel;
|
2012-05-08 15:43:59 +00:00
|
|
|
View2D *v2d = &ar->v2d;
|
2009-07-14 10:59:21 +00:00
|
|
|
View2DScrollers *scrollers;
|
2013-12-17 03:21:55 +11:00
|
|
|
int x, y, xco, yco, w, em, triangle;
|
2013-11-26 06:39:14 +11:00
|
|
|
bool is_context_new = 0;
|
2012-12-26 13:05:39 +00:00
|
|
|
int redo;
|
|
|
|
int scroll;
|
|
|
|
|
2013-12-17 03:21:55 +11:00
|
|
|
bool use_category_tabs = (ar->regiontype == RGN_TYPE_TOOLS); /* XXX, should use some better check? */
|
|
|
|
/* offset panels for small vertical tab area */
|
|
|
|
const char *category = NULL;
|
|
|
|
const int category_tabs_width = UI_PANEL_CATEGORY_MARGIN_WIDTH;
|
|
|
|
int margin_x = 0;
|
|
|
|
|
2013-12-04 11:54:56 +11:00
|
|
|
BLI_SMALLSTACK_DECLARE(pt_stack, PanelType *);
|
|
|
|
|
2014-02-01 01:45:09 +11:00
|
|
|
if (contextnr != -1)
|
2013-11-26 06:39:14 +11:00
|
|
|
is_context_new = UI_view2d_tab_set(v2d, contextnr);
|
2012-12-26 13:05:39 +00:00
|
|
|
|
|
|
|
/* before setting the view */
|
2012-03-24 06:38:07 +00:00
|
|
|
if (vertical) {
|
2012-12-26 13:05:39 +00:00
|
|
|
/* only allow scrolling in vertical direction */
|
|
|
|
v2d->keepofs |= V2D_LOCKOFS_X | V2D_KEEPOFS_Y;
|
|
|
|
v2d->keepofs &= ~(V2D_LOCKOFS_Y | V2D_KEEPOFS_X);
|
|
|
|
v2d->scroll &= ~(V2D_SCROLL_BOTTOM);
|
|
|
|
v2d->scroll |= (V2D_SCROLL_RIGHT);
|
2009-05-19 17:13:33 +00:00
|
|
|
}
|
|
|
|
else {
|
2012-12-26 13:05:39 +00:00
|
|
|
/* for now, allow scrolling in both directions (since layouts are optimized for vertical,
|
|
|
|
* they often don't fit in horizontal layout)
|
|
|
|
*/
|
|
|
|
v2d->keepofs &= ~(V2D_LOCKOFS_X | V2D_LOCKOFS_Y | V2D_KEEPOFS_X | V2D_KEEPOFS_Y);
|
|
|
|
v2d->scroll |= (V2D_SCROLL_BOTTOM);
|
|
|
|
v2d->scroll &= ~(V2D_SCROLL_RIGHT);
|
2009-05-19 17:13:33 +00:00
|
|
|
}
|
UI: Layout Engine
* Buttons are now created first, and after that the layout is computed.
This means the layout engine now works at button level, and makes it
easier to write templates. Otherwise you had to store all info and
create the buttons later.
* Added interface_templates.c as a separate file to put templates in.
These can contain regular buttons, and can be put in a Free layout,
which means you can specify manual coordinates, but still get nested
correct inside other layouts.
* API was changed to allow better nesting. Previously items were added
in the last added layout specifier, i.e. one level up in the layout
hierarchy. This doesn't work well in always, so now when creating things
like rows or columns it always returns a layout which you have to add
the items in. All py scripts were updated to follow this.
* Computing the layout now goes in two passes, first estimating the
required width/height of all nested layouts, and then in the second
pass using the results of that to decide on the actual locations.
* Enum and array buttons now follow the direction of the layout, i.e.
they are vertical or horizontal depending if they are in a column or row.
* Color properties now get a color picker, and only get the additional
RGB sliders with Expand=True.
* File/directory string properties now get a button next to them for
opening the file browse, though this is not implemented yet.
* Layout items can now be aligned, set align=True when creating a column,
row, etc.
* Buttons now get a minimum width of one icon (avoids squashing icon
buttons).
* Moved some more space variables into Style.
2009-05-15 11:19:59 +00:00
|
|
|
|
2012-12-26 13:05:39 +00:00
|
|
|
scroll = v2d->scroll;
|
2013-12-04 11:54:56 +11:00
|
|
|
|
|
|
|
|
|
|
|
/* collect panels to draw */
|
|
|
|
for (pt = ar->type->paneltypes.last; pt; pt = pt->prev) {
|
|
|
|
/* verify context */
|
|
|
|
if (context && pt->context[0] && !STREQ(context, pt->context)) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* draw panel */
|
|
|
|
if (pt->draw && (!pt->poll || pt->poll(C, pt))) {
|
|
|
|
BLI_SMALLSTACK_PUSH(pt_stack, pt);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-12-17 03:21:55 +11:00
|
|
|
/* collect categories */
|
|
|
|
if (use_category_tabs) {
|
|
|
|
UI_panel_category_clear_all(ar);
|
|
|
|
|
|
|
|
/* gather unique categories */
|
|
|
|
BLI_SMALLSTACK_ITER_BEGIN(pt_stack, pt)
|
|
|
|
{
|
|
|
|
if (pt->category[0]) {
|
|
|
|
if (!UI_panel_category_find(ar, pt->category)) {
|
|
|
|
UI_panel_category_add(ar, pt->category);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
BLI_SMALLSTACK_ITER_END;
|
|
|
|
|
|
|
|
if (!UI_panel_category_is_visible(ar)) {
|
|
|
|
use_category_tabs = false;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
category = UI_panel_category_active_get(ar, true);
|
|
|
|
margin_x = category_tabs_width;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2012-12-26 13:05:39 +00:00
|
|
|
/* sortof hack - but we cannot predict the height of panels, until it's being generated */
|
|
|
|
/* the layout engine works with fixed width (from v2d->cur), which is being set at end of the loop */
|
|
|
|
/* in case scroller settings (hide flags) differ from previous, the whole loop gets done again */
|
|
|
|
for (redo = 2; redo > 0; redo--) {
|
|
|
|
|
|
|
|
if (vertical) {
|
|
|
|
w = BLI_rctf_size_x(&v2d->cur);
|
2013-12-11 17:05:17 +01:00
|
|
|
em = (ar->type->prefsizex) ? 10 : 20; /* works out to 10*UI_UNIT_X or 20*UI_UNIT_X */
|
2012-12-26 13:05:39 +00:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
w = UI_PANEL_WIDTH;
|
2013-12-11 17:05:17 +01:00
|
|
|
em = (ar->type->prefsizex) ? 10 : 20;
|
2012-12-26 13:05:39 +00:00
|
|
|
}
|
2013-12-17 03:21:55 +11:00
|
|
|
|
|
|
|
w -= margin_x;
|
2012-12-26 13:05:39 +00:00
|
|
|
|
|
|
|
/* create panels */
|
2014-11-09 21:20:40 +01:00
|
|
|
UI_panels_begin(C, ar);
|
UI: Layout Engine
* Buttons are now created first, and after that the layout is computed.
This means the layout engine now works at button level, and makes it
easier to write templates. Otherwise you had to store all info and
create the buttons later.
* Added interface_templates.c as a separate file to put templates in.
These can contain regular buttons, and can be put in a Free layout,
which means you can specify manual coordinates, but still get nested
correct inside other layouts.
* API was changed to allow better nesting. Previously items were added
in the last added layout specifier, i.e. one level up in the layout
hierarchy. This doesn't work well in always, so now when creating things
like rows or columns it always returns a layout which you have to add
the items in. All py scripts were updated to follow this.
* Computing the layout now goes in two passes, first estimating the
required width/height of all nested layouts, and then in the second
pass using the results of that to decide on the actual locations.
* Enum and array buttons now follow the direction of the layout, i.e.
they are vertical or horizontal depending if they are in a column or row.
* Color properties now get a color picker, and only get the additional
RGB sliders with Expand=True.
* File/directory string properties now get a button next to them for
opening the file browse, though this is not implemented yet.
* Layout items can now be aligned, set align=True when creating a column,
row, etc.
* Buttons now get a minimum width of one icon (avoids squashing icon
buttons).
* Moved some more space variables into Style.
2009-05-15 11:19:59 +00:00
|
|
|
|
2014-11-09 21:20:40 +01:00
|
|
|
/* set view2d view matrix - UI_block_begin() stores it */
|
2012-12-26 13:05:39 +00:00
|
|
|
UI_view2d_view_ortho(v2d);
|
2009-05-19 17:13:33 +00:00
|
|
|
|
2013-12-04 11:54:56 +11:00
|
|
|
BLI_SMALLSTACK_ITER_BEGIN(pt_stack, pt)
|
|
|
|
{
|
2013-12-17 03:21:55 +11:00
|
|
|
bool open;
|
|
|
|
|
2014-11-09 21:20:40 +01:00
|
|
|
panel = UI_panel_find_by_type(ar, pt);
|
2013-12-17 03:21:55 +11:00
|
|
|
|
2013-12-17 19:16:44 +11:00
|
|
|
if (use_category_tabs && pt->category[0] && !STREQ(category, pt->category)) {
|
2013-12-17 03:21:55 +11:00
|
|
|
if ((panel == NULL) || ((panel->flag & PNL_PIN) == 0)) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* draw panel */
|
2014-11-09 21:20:40 +01:00
|
|
|
block = UI_block_begin(C, ar, pt->idname, UI_EMBOSS);
|
|
|
|
panel = UI_panel_begin(sa, ar, block, pt, panel, &open);
|
UI: Layout Engine
* Buttons are now created first, and after that the layout is computed.
This means the layout engine now works at button level, and makes it
easier to write templates. Otherwise you had to store all info and
create the buttons later.
* Added interface_templates.c as a separate file to put templates in.
These can contain regular buttons, and can be put in a Free layout,
which means you can specify manual coordinates, but still get nested
correct inside other layouts.
* API was changed to allow better nesting. Previously items were added
in the last added layout specifier, i.e. one level up in the layout
hierarchy. This doesn't work well in always, so now when creating things
like rows or columns it always returns a layout which you have to add
the items in. All py scripts were updated to follow this.
* Computing the layout now goes in two passes, first estimating the
required width/height of all nested layouts, and then in the second
pass using the results of that to decide on the actual locations.
* Enum and array buttons now follow the direction of the layout, i.e.
they are vertical or horizontal depending if they are in a column or row.
* Color properties now get a color picker, and only get the additional
RGB sliders with Expand=True.
* File/directory string properties now get a button next to them for
opening the file browse, though this is not implemented yet.
* Layout items can now be aligned, set align=True when creating a column,
row, etc.
* Buttons now get a minimum width of one icon (avoids squashing icon
buttons).
* Moved some more space variables into Style.
2009-05-15 11:19:59 +00:00
|
|
|
|
2013-12-04 11:54:56 +11:00
|
|
|
/* bad fixed values */
|
|
|
|
triangle = (int)(UI_UNIT_Y * 1.1f);
|
UI: Layout Engine
* Buttons are now created first, and after that the layout is computed.
This means the layout engine now works at button level, and makes it
easier to write templates. Otherwise you had to store all info and
create the buttons later.
* Added interface_templates.c as a separate file to put templates in.
These can contain regular buttons, and can be put in a Free layout,
which means you can specify manual coordinates, but still get nested
correct inside other layouts.
* API was changed to allow better nesting. Previously items were added
in the last added layout specifier, i.e. one level up in the layout
hierarchy. This doesn't work well in always, so now when creating things
like rows or columns it always returns a layout which you have to add
the items in. All py scripts were updated to follow this.
* Computing the layout now goes in two passes, first estimating the
required width/height of all nested layouts, and then in the second
pass using the results of that to decide on the actual locations.
* Enum and array buttons now follow the direction of the layout, i.e.
they are vertical or horizontal depending if they are in a column or row.
* Color properties now get a color picker, and only get the additional
RGB sliders with Expand=True.
* File/directory string properties now get a button next to them for
opening the file browse, though this is not implemented yet.
* Layout items can now be aligned, set align=True when creating a column,
row, etc.
* Buttons now get a minimum width of one icon (avoids squashing icon
buttons).
* Moved some more space variables into Style.
2009-05-15 11:19:59 +00:00
|
|
|
|
2013-12-04 11:54:56 +11:00
|
|
|
if (pt->draw_header && !(pt->flag & PNL_NO_HEADER) && (open || vertical)) {
|
|
|
|
/* for enabled buttons */
|
2014-11-09 21:20:40 +01:00
|
|
|
panel->layout = UI_block_layout(
|
|
|
|
block, UI_LAYOUT_HORIZONTAL, UI_LAYOUT_HEADER,
|
|
|
|
triangle, (UI_UNIT_Y * 1.1f) + style->panelspace, UI_UNIT_Y, 1, 0, style);
|
2009-07-08 15:34:41 +00:00
|
|
|
|
2013-12-04 11:54:56 +11:00
|
|
|
pt->draw_header(C, panel);
|
2009-05-19 17:13:33 +00:00
|
|
|
|
2014-11-09 21:20:40 +01:00
|
|
|
UI_block_layout_resolve(block, &xco, &yco);
|
2013-12-04 11:54:56 +11:00
|
|
|
panel->labelofs = xco - triangle;
|
|
|
|
panel->layout = NULL;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
panel->labelofs = 0;
|
|
|
|
}
|
2009-05-19 17:13:33 +00:00
|
|
|
|
2013-12-04 11:54:56 +11:00
|
|
|
if (open) {
|
|
|
|
short panelContext;
|
UI: Layout Engine
* Buttons are now created first, and after that the layout is computed.
This means the layout engine now works at button level, and makes it
easier to write templates. Otherwise you had to store all info and
create the buttons later.
* Added interface_templates.c as a separate file to put templates in.
These can contain regular buttons, and can be put in a Free layout,
which means you can specify manual coordinates, but still get nested
correct inside other layouts.
* API was changed to allow better nesting. Previously items were added
in the last added layout specifier, i.e. one level up in the layout
hierarchy. This doesn't work well in always, so now when creating things
like rows or columns it always returns a layout which you have to add
the items in. All py scripts were updated to follow this.
* Computing the layout now goes in two passes, first estimating the
required width/height of all nested layouts, and then in the second
pass using the results of that to decide on the actual locations.
* Enum and array buttons now follow the direction of the layout, i.e.
they are vertical or horizontal depending if they are in a column or row.
* Color properties now get a color picker, and only get the additional
RGB sliders with Expand=True.
* File/directory string properties now get a button next to them for
opening the file browse, though this is not implemented yet.
* Layout items can now be aligned, set align=True when creating a column,
row, etc.
* Buttons now get a minimum width of one icon (avoids squashing icon
buttons).
* Moved some more space variables into Style.
2009-05-15 11:19:59 +00:00
|
|
|
|
2013-12-04 11:54:56 +11:00
|
|
|
/* panel context can either be toolbar region or normal panels region */
|
|
|
|
if (ar->regiontype == RGN_TYPE_TOOLS)
|
|
|
|
panelContext = UI_LAYOUT_TOOLBAR;
|
|
|
|
else
|
|
|
|
panelContext = UI_LAYOUT_PANEL;
|
2012-12-26 13:05:39 +00:00
|
|
|
|
2014-11-09 21:20:40 +01:00
|
|
|
panel->layout = UI_block_layout(
|
|
|
|
block, UI_LAYOUT_VERTICAL, panelContext,
|
|
|
|
style->panelspace, 0, w - 2 * style->panelspace, em, 0, style);
|
2013-12-04 11:54:56 +11:00
|
|
|
|
|
|
|
pt->draw(C, panel);
|
|
|
|
|
2014-11-09 21:20:40 +01:00
|
|
|
UI_block_layout_resolve(block, &xco, &yco);
|
2013-12-04 11:54:56 +11:00
|
|
|
panel->layout = NULL;
|
|
|
|
|
|
|
|
yco -= 2 * style->panelspace;
|
2014-11-09 21:20:40 +01:00
|
|
|
UI_panel_end(block, w, -yco);
|
2009-06-16 01:08:39 +00:00
|
|
|
}
|
2013-12-04 11:54:56 +11:00
|
|
|
else {
|
|
|
|
yco = 0;
|
2014-11-09 21:20:40 +01:00
|
|
|
UI_panel_end(block, w, 0);
|
2013-12-04 11:54:56 +11:00
|
|
|
}
|
|
|
|
|
2014-11-09 21:20:40 +01:00
|
|
|
UI_block_end(C, block);
|
2012-12-26 13:05:39 +00:00
|
|
|
}
|
2013-12-04 11:54:56 +11:00
|
|
|
BLI_SMALLSTACK_ITER_END;
|
UI: Layout Engine
* Buttons are now created first, and after that the layout is computed.
This means the layout engine now works at button level, and makes it
easier to write templates. Otherwise you had to store all info and
create the buttons later.
* Added interface_templates.c as a separate file to put templates in.
These can contain regular buttons, and can be put in a Free layout,
which means you can specify manual coordinates, but still get nested
correct inside other layouts.
* API was changed to allow better nesting. Previously items were added
in the last added layout specifier, i.e. one level up in the layout
hierarchy. This doesn't work well in always, so now when creating things
like rows or columns it always returns a layout which you have to add
the items in. All py scripts were updated to follow this.
* Computing the layout now goes in two passes, first estimating the
required width/height of all nested layouts, and then in the second
pass using the results of that to decide on the actual locations.
* Enum and array buttons now follow the direction of the layout, i.e.
they are vertical or horizontal depending if they are in a column or row.
* Color properties now get a color picker, and only get the additional
RGB sliders with Expand=True.
* File/directory string properties now get a button next to them for
opening the file browse, though this is not implemented yet.
* Layout items can now be aligned, set align=True when creating a column,
row, etc.
* Buttons now get a minimum width of one icon (avoids squashing icon
buttons).
* Moved some more space variables into Style.
2009-05-15 11:19:59 +00:00
|
|
|
|
2012-12-26 13:05:39 +00:00
|
|
|
/* align panels and return size */
|
2014-11-09 21:20:40 +01:00
|
|
|
UI_panels_end(C, ar, &x, &y);
|
2012-12-26 13:05:39 +00:00
|
|
|
|
|
|
|
/* before setting the view */
|
|
|
|
if (vertical) {
|
|
|
|
/* we always keep the scroll offset - so the total view gets increased with the scrolled away part */
|
|
|
|
if (v2d->cur.ymax < - 0.001f)
|
|
|
|
y = min_ii(y, v2d->cur.ymin);
|
|
|
|
|
|
|
|
y = -y;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
/* don't jump back when panels close or hide */
|
2013-11-26 06:39:14 +11:00
|
|
|
if (!is_context_new)
|
2012-12-26 13:05:39 +00:00
|
|
|
x = max_ii(x, v2d->cur.xmax);
|
|
|
|
y = -y;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* this also changes the 'cur' */
|
|
|
|
UI_view2d_totRect_set(v2d, x, y);
|
|
|
|
|
|
|
|
if (scroll != v2d->scroll) {
|
|
|
|
/* Note: this code scales fine, but because of rounding differences, positions of elements
|
|
|
|
* flip +1 or -1 pixel compared to redoing the entire layout again.
|
|
|
|
* Leaving in commented code for future tests */
|
2013-09-14 12:04:10 +00:00
|
|
|
#if 0
|
2014-11-09 21:20:40 +01:00
|
|
|
UI_panels_scale(ar, BLI_rctf_size_x(&v2d->cur));
|
2013-09-14 12:04:10 +00:00
|
|
|
break;
|
|
|
|
#endif
|
UI: Layout Engine
* Buttons are now created first, and after that the layout is computed.
This means the layout engine now works at button level, and makes it
easier to write templates. Otherwise you had to store all info and
create the buttons later.
* Added interface_templates.c as a separate file to put templates in.
These can contain regular buttons, and can be put in a Free layout,
which means you can specify manual coordinates, but still get nested
correct inside other layouts.
* API was changed to allow better nesting. Previously items were added
in the last added layout specifier, i.e. one level up in the layout
hierarchy. This doesn't work well in always, so now when creating things
like rows or columns it always returns a layout which you have to add
the items in. All py scripts were updated to follow this.
* Computing the layout now goes in two passes, first estimating the
required width/height of all nested layouts, and then in the second
pass using the results of that to decide on the actual locations.
* Enum and array buttons now follow the direction of the layout, i.e.
they are vertical or horizontal depending if they are in a column or row.
* Color properties now get a color picker, and only get the additional
RGB sliders with Expand=True.
* File/directory string properties now get a button next to them for
opening the file browse, though this is not implemented yet.
* Layout items can now be aligned, set align=True when creating a column,
row, etc.
* Buttons now get a minimum width of one icon (avoids squashing icon
buttons).
* Moved some more space variables into Style.
2009-05-15 11:19:59 +00:00
|
|
|
}
|
2013-03-09 03:46:30 +00:00
|
|
|
else {
|
|
|
|
break;
|
|
|
|
}
|
UI: Layout Engine
* Buttons are now created first, and after that the layout is computed.
This means the layout engine now works at button level, and makes it
easier to write templates. Otherwise you had to store all info and
create the buttons later.
* Added interface_templates.c as a separate file to put templates in.
These can contain regular buttons, and can be put in a Free layout,
which means you can specify manual coordinates, but still get nested
correct inside other layouts.
* API was changed to allow better nesting. Previously items were added
in the last added layout specifier, i.e. one level up in the layout
hierarchy. This doesn't work well in always, so now when creating things
like rows or columns it always returns a layout which you have to add
the items in. All py scripts were updated to follow this.
* Computing the layout now goes in two passes, first estimating the
required width/height of all nested layouts, and then in the second
pass using the results of that to decide on the actual locations.
* Enum and array buttons now follow the direction of the layout, i.e.
they are vertical or horizontal depending if they are in a column or row.
* Color properties now get a color picker, and only get the additional
RGB sliders with Expand=True.
* File/directory string properties now get a button next to them for
opening the file browse, though this is not implemented yet.
* Layout items can now be aligned, set align=True when creating a column,
row, etc.
* Buttons now get a minimum width of one icon (avoids squashing icon
buttons).
* Moved some more space variables into Style.
2009-05-15 11:19:59 +00:00
|
|
|
}
|
2014-07-12 16:48:52 +10:00
|
|
|
|
2009-05-19 17:13:33 +00:00
|
|
|
/* clear */
|
Holiday coding log :)
Nice formatted version (pictures soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.66/Usability
Short list of main changes:
- Transparent region option (over main region), added code to blend in/out such panels.
- Min size window now 640 x 480
- Fixed DPI for ui - lots of cleanup and changes everywhere. Icon image need correct size still, layer-in-use icon needs remake.
- Macbook retina support, use command line --no-native-pixels to disable it
- Timeline Marker label was drawing wrong
- Trackpad and magic mouse: supports zoom (hold ctrl)
- Fix for splash position: removed ghost function and made window size update after creation immediate
- Fast undo buffer save now adds UI as well. Could be checked for regular file save even...
Quit.blend and temp file saving use this now.
- Dixed filename in window on reading quit.blend or temp saves, and they now add a warning in window title: "(Recovered)"
- New Userpref option "Keep Session" - this always saves quit.blend, and loads on start.
This allows keeping UI and data without actual saves, until you actually save.
When you load startup.blend and quit, it recognises the quit.blend as a startup (no file name in header)
- Added 3D view copy/paste buffers (selected objects). Shortcuts ctrl-c, ctrl-v (OSX, cmd-c, cmd-v).
Coded partial file saving for it. Could be used for other purposes. Todo: use OS clipboards.
- User preferences (themes, keymaps, user settings) now can be saved as a separate file.
Old option is called "Save Startup File" the new one "Save User Settings".
To visualise this difference, the 'save startup file' button has been removed from user preferences window. That option is available as CTRL+U and in File menu still.
- OSX: fixed bug that stopped giving mouse events outside window.
This also fixes "Continuous Grab" for OSX. (error since 2009)
2012-12-12 18:58:11 +00:00
|
|
|
if (ar->overlap) {
|
|
|
|
/* view should be in pixelspace */
|
|
|
|
UI_view2d_view_restore(C);
|
|
|
|
glEnable(GL_BLEND);
|
|
|
|
UI_ThemeColor4((ar->type->regionid == RGN_TYPE_PREVIEW) ? TH_PREVIEW_BACK : TH_BACK);
|
2015-06-30 21:02:19 +02:00
|
|
|
glRecti(0, 0, BLI_rcti_size_x(&ar->winrct), BLI_rcti_size_y(&ar->winrct) + 1);
|
Holiday coding log :)
Nice formatted version (pictures soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.66/Usability
Short list of main changes:
- Transparent region option (over main region), added code to blend in/out such panels.
- Min size window now 640 x 480
- Fixed DPI for ui - lots of cleanup and changes everywhere. Icon image need correct size still, layer-in-use icon needs remake.
- Macbook retina support, use command line --no-native-pixels to disable it
- Timeline Marker label was drawing wrong
- Trackpad and magic mouse: supports zoom (hold ctrl)
- Fix for splash position: removed ghost function and made window size update after creation immediate
- Fast undo buffer save now adds UI as well. Could be checked for regular file save even...
Quit.blend and temp file saving use this now.
- Dixed filename in window on reading quit.blend or temp saves, and they now add a warning in window title: "(Recovered)"
- New Userpref option "Keep Session" - this always saves quit.blend, and loads on start.
This allows keeping UI and data without actual saves, until you actually save.
When you load startup.blend and quit, it recognises the quit.blend as a startup (no file name in header)
- Added 3D view copy/paste buffers (selected objects). Shortcuts ctrl-c, ctrl-v (OSX, cmd-c, cmd-v).
Coded partial file saving for it. Could be used for other purposes. Todo: use OS clipboards.
- User preferences (themes, keymaps, user settings) now can be saved as a separate file.
Old option is called "Save Startup File" the new one "Save User Settings".
To visualise this difference, the 'save startup file' button has been removed from user preferences window. That option is available as CTRL+U and in File menu still.
- OSX: fixed bug that stopped giving mouse events outside window.
This also fixes "Continuous Grab" for OSX. (error since 2009)
2012-12-12 18:58:11 +00:00
|
|
|
glDisable(GL_BLEND);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
UI_ThemeClearColor((ar->type->regionid == RGN_TYPE_PREVIEW) ? TH_PREVIEW_BACK : TH_BACK);
|
|
|
|
glClear(GL_COLOR_BUFFER_BIT);
|
|
|
|
}
|
2010-04-06 07:02:16 +00:00
|
|
|
|
2009-05-19 17:13:33 +00:00
|
|
|
|
|
|
|
/* set the view */
|
2010-10-14 01:22:14 +00:00
|
|
|
UI_view2d_view_ortho(v2d);
|
2009-05-19 17:13:33 +00:00
|
|
|
|
2011-11-20 14:31:01 +00:00
|
|
|
/* draw panels */
|
2014-11-09 21:20:40 +01:00
|
|
|
UI_panels_draw(C, ar);
|
2011-11-20 14:31:01 +00:00
|
|
|
|
2009-05-19 17:13:33 +00:00
|
|
|
/* restore view matrix */
|
UI: Layout Engine
* Buttons are now created first, and after that the layout is computed.
This means the layout engine now works at button level, and makes it
easier to write templates. Otherwise you had to store all info and
create the buttons later.
* Added interface_templates.c as a separate file to put templates in.
These can contain regular buttons, and can be put in a Free layout,
which means you can specify manual coordinates, but still get nested
correct inside other layouts.
* API was changed to allow better nesting. Previously items were added
in the last added layout specifier, i.e. one level up in the layout
hierarchy. This doesn't work well in always, so now when creating things
like rows or columns it always returns a layout which you have to add
the items in. All py scripts were updated to follow this.
* Computing the layout now goes in two passes, first estimating the
required width/height of all nested layouts, and then in the second
pass using the results of that to decide on the actual locations.
* Enum and array buttons now follow the direction of the layout, i.e.
they are vertical or horizontal depending if they are in a column or row.
* Color properties now get a color picker, and only get the additional
RGB sliders with Expand=True.
* File/directory string properties now get a button next to them for
opening the file browse, though this is not implemented yet.
* Layout items can now be aligned, set align=True when creating a column,
row, etc.
* Buttons now get a minimum width of one icon (avoids squashing icon
buttons).
* Moved some more space variables into Style.
2009-05-15 11:19:59 +00:00
|
|
|
UI_view2d_view_restore(C);
|
2009-07-14 10:59:21 +00:00
|
|
|
|
2013-12-17 03:21:55 +11:00
|
|
|
if (use_category_tabs) {
|
|
|
|
UI_panel_category_draw_all(ar, category);
|
|
|
|
}
|
|
|
|
|
2009-07-14 10:59:21 +00:00
|
|
|
/* scrollers */
|
2012-05-08 15:43:59 +00:00
|
|
|
scrollers = UI_view2d_scrollers_calc(C, v2d, V2D_ARG_DUMMY, V2D_ARG_DUMMY, V2D_ARG_DUMMY, V2D_ARG_DUMMY);
|
2009-07-14 10:59:21 +00:00
|
|
|
UI_view2d_scrollers_draw(C, v2d, scrollers);
|
|
|
|
UI_view2d_scrollers_free(scrollers);
|
UI: Layout Engine
* Buttons are now created first, and after that the layout is computed.
This means the layout engine now works at button level, and makes it
easier to write templates. Otherwise you had to store all info and
create the buttons later.
* Added interface_templates.c as a separate file to put templates in.
These can contain regular buttons, and can be put in a Free layout,
which means you can specify manual coordinates, but still get nested
correct inside other layouts.
* API was changed to allow better nesting. Previously items were added
in the last added layout specifier, i.e. one level up in the layout
hierarchy. This doesn't work well in always, so now when creating things
like rows or columns it always returns a layout which you have to add
the items in. All py scripts were updated to follow this.
* Computing the layout now goes in two passes, first estimating the
required width/height of all nested layouts, and then in the second
pass using the results of that to decide on the actual locations.
* Enum and array buttons now follow the direction of the layout, i.e.
they are vertical or horizontal depending if they are in a column or row.
* Color properties now get a color picker, and only get the additional
RGB sliders with Expand=True.
* File/directory string properties now get a button next to them for
opening the file browse, though this is not implemented yet.
* Layout items can now be aligned, set align=True when creating a column,
row, etc.
* Buttons now get a minimum width of one icon (avoids squashing icon
buttons).
* Moved some more space variables into Style.
2009-05-15 11:19:59 +00:00
|
|
|
}
|
|
|
|
|
2009-05-19 17:13:33 +00:00
|
|
|
void ED_region_panels_init(wmWindowManager *wm, ARegion *ar)
|
|
|
|
{
|
2009-09-17 21:36:02 +00:00
|
|
|
wmKeyMap *keymap;
|
2012-07-07 22:51:57 +00:00
|
|
|
|
2009-05-19 17:13:33 +00:00
|
|
|
UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_PANELS_UI, ar->winx, ar->winy);
|
|
|
|
|
2012-03-24 02:51:46 +00:00
|
|
|
keymap = WM_keymap_find(wm->defaultconf, "View2D Buttons List", 0, 0);
|
2009-05-19 17:13:33 +00:00
|
|
|
WM_event_add_keymap_handler(&ar->handlers, keymap);
|
|
|
|
}
|
|
|
|
|
UI: Layout Engine
* Buttons are now created first, and after that the layout is computed.
This means the layout engine now works at button level, and makes it
easier to write templates. Otherwise you had to store all info and
create the buttons later.
* Added interface_templates.c as a separate file to put templates in.
These can contain regular buttons, and can be put in a Free layout,
which means you can specify manual coordinates, but still get nested
correct inside other layouts.
* API was changed to allow better nesting. Previously items were added
in the last added layout specifier, i.e. one level up in the layout
hierarchy. This doesn't work well in always, so now when creating things
like rows or columns it always returns a layout which you have to add
the items in. All py scripts were updated to follow this.
* Computing the layout now goes in two passes, first estimating the
required width/height of all nested layouts, and then in the second
pass using the results of that to decide on the actual locations.
* Enum and array buttons now follow the direction of the layout, i.e.
they are vertical or horizontal depending if they are in a column or row.
* Color properties now get a color picker, and only get the additional
RGB sliders with Expand=True.
* File/directory string properties now get a button next to them for
opening the file browse, though this is not implemented yet.
* Layout items can now be aligned, set align=True when creating a column,
row, etc.
* Buttons now get a minimum width of one icon (avoids squashing icon
buttons).
* Moved some more space variables into Style.
2009-05-15 11:19:59 +00:00
|
|
|
void ED_region_header(const bContext *C, ARegion *ar)
|
|
|
|
{
|
2014-11-09 21:20:40 +01:00
|
|
|
uiStyle *style = UI_style_get_dpi();
|
UI: Layout Engine
* Buttons are now created first, and after that the layout is computed.
This means the layout engine now works at button level, and makes it
easier to write templates. Otherwise you had to store all info and
create the buttons later.
* Added interface_templates.c as a separate file to put templates in.
These can contain regular buttons, and can be put in a Free layout,
which means you can specify manual coordinates, but still get nested
correct inside other layouts.
* API was changed to allow better nesting. Previously items were added
in the last added layout specifier, i.e. one level up in the layout
hierarchy. This doesn't work well in always, so now when creating things
like rows or columns it always returns a layout which you have to add
the items in. All py scripts were updated to follow this.
* Computing the layout now goes in two passes, first estimating the
required width/height of all nested layouts, and then in the second
pass using the results of that to decide on the actual locations.
* Enum and array buttons now follow the direction of the layout, i.e.
they are vertical or horizontal depending if they are in a column or row.
* Color properties now get a color picker, and only get the additional
RGB sliders with Expand=True.
* File/directory string properties now get a button next to them for
opening the file browse, though this is not implemented yet.
* Layout items can now be aligned, set align=True when creating a column,
row, etc.
* Buttons now get a minimum width of one icon (avoids squashing icon
buttons).
* Moved some more space variables into Style.
2009-05-15 11:19:59 +00:00
|
|
|
uiBlock *block;
|
|
|
|
uiLayout *layout;
|
|
|
|
HeaderType *ht;
|
2011-03-05 10:29:10 +00:00
|
|
|
Header header = {NULL};
|
2009-08-16 13:01:40 +00:00
|
|
|
int maxco, xco, yco;
|
2012-05-08 15:43:59 +00:00
|
|
|
int headery = ED_area_headersize();
|
UI: Layout Engine
* Buttons are now created first, and after that the layout is computed.
This means the layout engine now works at button level, and makes it
easier to write templates. Otherwise you had to store all info and
create the buttons later.
* Added interface_templates.c as a separate file to put templates in.
These can contain regular buttons, and can be put in a Free layout,
which means you can specify manual coordinates, but still get nested
correct inside other layouts.
* API was changed to allow better nesting. Previously items were added
in the last added layout specifier, i.e. one level up in the layout
hierarchy. This doesn't work well in always, so now when creating things
like rows or columns it always returns a layout which you have to add
the items in. All py scripts were updated to follow this.
* Computing the layout now goes in two passes, first estimating the
required width/height of all nested layouts, and then in the second
pass using the results of that to decide on the actual locations.
* Enum and array buttons now follow the direction of the layout, i.e.
they are vertical or horizontal depending if they are in a column or row.
* Color properties now get a color picker, and only get the additional
RGB sliders with Expand=True.
* File/directory string properties now get a button next to them for
opening the file browse, though this is not implemented yet.
* Layout items can now be aligned, set align=True when creating a column,
row, etc.
* Buttons now get a minimum width of one icon (avoids squashing icon
buttons).
* Moved some more space variables into Style.
2009-05-15 11:19:59 +00:00
|
|
|
|
2012-10-21 05:46:41 +00:00
|
|
|
/* clear */
|
2012-05-08 15:43:59 +00:00
|
|
|
UI_ThemeClearColor((ED_screen_area_active(C)) ? TH_HEADER : TH_HEADERDESEL);
|
UI: Layout Engine
* Buttons are now created first, and after that the layout is computed.
This means the layout engine now works at button level, and makes it
easier to write templates. Otherwise you had to store all info and
create the buttons later.
* Added interface_templates.c as a separate file to put templates in.
These can contain regular buttons, and can be put in a Free layout,
which means you can specify manual coordinates, but still get nested
correct inside other layouts.
* API was changed to allow better nesting. Previously items were added
in the last added layout specifier, i.e. one level up in the layout
hierarchy. This doesn't work well in always, so now when creating things
like rows or columns it always returns a layout which you have to add
the items in. All py scripts were updated to follow this.
* Computing the layout now goes in two passes, first estimating the
required width/height of all nested layouts, and then in the second
pass using the results of that to decide on the actual locations.
* Enum and array buttons now follow the direction of the layout, i.e.
they are vertical or horizontal depending if they are in a column or row.
* Color properties now get a color picker, and only get the additional
RGB sliders with Expand=True.
* File/directory string properties now get a button next to them for
opening the file browse, though this is not implemented yet.
* Layout items can now be aligned, set align=True when creating a column,
row, etc.
* Buttons now get a minimum width of one icon (avoids squashing icon
buttons).
* Moved some more space variables into Style.
2009-05-15 11:19:59 +00:00
|
|
|
glClear(GL_COLOR_BUFFER_BIT);
|
|
|
|
|
|
|
|
/* set view2d view matrix for scrolling (without scrollers) */
|
2010-10-14 01:22:14 +00:00
|
|
|
UI_view2d_view_ortho(&ar->v2d);
|
UI: Layout Engine
* Buttons are now created first, and after that the layout is computed.
This means the layout engine now works at button level, and makes it
easier to write templates. Otherwise you had to store all info and
create the buttons later.
* Added interface_templates.c as a separate file to put templates in.
These can contain regular buttons, and can be put in a Free layout,
which means you can specify manual coordinates, but still get nested
correct inside other layouts.
* API was changed to allow better nesting. Previously items were added
in the last added layout specifier, i.e. one level up in the layout
hierarchy. This doesn't work well in always, so now when creating things
like rows or columns it always returns a layout which you have to add
the items in. All py scripts were updated to follow this.
* Computing the layout now goes in two passes, first estimating the
required width/height of all nested layouts, and then in the second
pass using the results of that to decide on the actual locations.
* Enum and array buttons now follow the direction of the layout, i.e.
they are vertical or horizontal depending if they are in a column or row.
* Color properties now get a color picker, and only get the additional
RGB sliders with Expand=True.
* File/directory string properties now get a button next to them for
opening the file browse, though this is not implemented yet.
* Layout items can now be aligned, set align=True when creating a column,
row, etc.
* Buttons now get a minimum width of one icon (avoids squashing icon
buttons).
* Moved some more space variables into Style.
2009-05-15 11:19:59 +00:00
|
|
|
|
Holiday coding log :)
Nice formatted version (pictures soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.66/Usability
Short list of main changes:
- Transparent region option (over main region), added code to blend in/out such panels.
- Min size window now 640 x 480
- Fixed DPI for ui - lots of cleanup and changes everywhere. Icon image need correct size still, layer-in-use icon needs remake.
- Macbook retina support, use command line --no-native-pixels to disable it
- Timeline Marker label was drawing wrong
- Trackpad and magic mouse: supports zoom (hold ctrl)
- Fix for splash position: removed ghost function and made window size update after creation immediate
- Fast undo buffer save now adds UI as well. Could be checked for regular file save even...
Quit.blend and temp file saving use this now.
- Dixed filename in window on reading quit.blend or temp saves, and they now add a warning in window title: "(Recovered)"
- New Userpref option "Keep Session" - this always saves quit.blend, and loads on start.
This allows keeping UI and data without actual saves, until you actually save.
When you load startup.blend and quit, it recognises the quit.blend as a startup (no file name in header)
- Added 3D view copy/paste buffers (selected objects). Shortcuts ctrl-c, ctrl-v (OSX, cmd-c, cmd-v).
Coded partial file saving for it. Could be used for other purposes. Todo: use OS clipboards.
- User preferences (themes, keymaps, user settings) now can be saved as a separate file.
Old option is called "Save Startup File" the new one "Save User Settings".
To visualise this difference, the 'save startup file' button has been removed from user preferences window. That option is available as CTRL+U and in File menu still.
- OSX: fixed bug that stopped giving mouse events outside window.
This also fixes "Continuous Grab" for OSX. (error since 2009)
2012-12-12 18:58:11 +00:00
|
|
|
xco = maxco = 0.4f * UI_UNIT_X;
|
|
|
|
yco = headery - floor(0.2f * UI_UNIT_Y);
|
UI: Layout Engine
* Buttons are now created first, and after that the layout is computed.
This means the layout engine now works at button level, and makes it
easier to write templates. Otherwise you had to store all info and
create the buttons later.
* Added interface_templates.c as a separate file to put templates in.
These can contain regular buttons, and can be put in a Free layout,
which means you can specify manual coordinates, but still get nested
correct inside other layouts.
* API was changed to allow better nesting. Previously items were added
in the last added layout specifier, i.e. one level up in the layout
hierarchy. This doesn't work well in always, so now when creating things
like rows or columns it always returns a layout which you have to add
the items in. All py scripts were updated to follow this.
* Computing the layout now goes in two passes, first estimating the
required width/height of all nested layouts, and then in the second
pass using the results of that to decide on the actual locations.
* Enum and array buttons now follow the direction of the layout, i.e.
they are vertical or horizontal depending if they are in a column or row.
* Color properties now get a color picker, and only get the additional
RGB sliders with Expand=True.
* File/directory string properties now get a button next to them for
opening the file browse, though this is not implemented yet.
* Layout items can now be aligned, set align=True when creating a column,
row, etc.
* Buttons now get a minimum width of one icon (avoids squashing icon
buttons).
* Moved some more space variables into Style.
2009-05-15 11:19:59 +00:00
|
|
|
|
|
|
|
/* draw all headers types */
|
2012-05-08 15:43:59 +00:00
|
|
|
for (ht = ar->type->headertypes.first; ht; ht = ht->next) {
|
2014-11-09 21:20:40 +01:00
|
|
|
block = UI_block_begin(C, ar, ht->idname, UI_EMBOSS);
|
|
|
|
layout = UI_block_layout(block, UI_LAYOUT_HORIZONTAL, UI_LAYOUT_HEADER, xco, yco, UI_UNIT_Y, 1, 0, style);
|
UI: Layout Engine
* Buttons are now created first, and after that the layout is computed.
This means the layout engine now works at button level, and makes it
easier to write templates. Otherwise you had to store all info and
create the buttons later.
* Added interface_templates.c as a separate file to put templates in.
These can contain regular buttons, and can be put in a Free layout,
which means you can specify manual coordinates, but still get nested
correct inside other layouts.
* API was changed to allow better nesting. Previously items were added
in the last added layout specifier, i.e. one level up in the layout
hierarchy. This doesn't work well in always, so now when creating things
like rows or columns it always returns a layout which you have to add
the items in. All py scripts were updated to follow this.
* Computing the layout now goes in two passes, first estimating the
required width/height of all nested layouts, and then in the second
pass using the results of that to decide on the actual locations.
* Enum and array buttons now follow the direction of the layout, i.e.
they are vertical or horizontal depending if they are in a column or row.
* Color properties now get a color picker, and only get the additional
RGB sliders with Expand=True.
* File/directory string properties now get a button next to them for
opening the file browse, though this is not implemented yet.
* Layout items can now be aligned, set align=True when creating a column,
row, etc.
* Buttons now get a minimum width of one icon (avoids squashing icon
buttons).
* Moved some more space variables into Style.
2009-05-15 11:19:59 +00:00
|
|
|
|
2012-03-24 06:38:07 +00:00
|
|
|
if (ht->draw) {
|
2012-05-08 15:43:59 +00:00
|
|
|
header.type = ht;
|
|
|
|
header.layout = layout;
|
UI: Layout Engine
* Buttons are now created first, and after that the layout is computed.
This means the layout engine now works at button level, and makes it
easier to write templates. Otherwise you had to store all info and
create the buttons later.
* Added interface_templates.c as a separate file to put templates in.
These can contain regular buttons, and can be put in a Free layout,
which means you can specify manual coordinates, but still get nested
correct inside other layouts.
* API was changed to allow better nesting. Previously items were added
in the last added layout specifier, i.e. one level up in the layout
hierarchy. This doesn't work well in always, so now when creating things
like rows or columns it always returns a layout which you have to add
the items in. All py scripts were updated to follow this.
* Computing the layout now goes in two passes, first estimating the
required width/height of all nested layouts, and then in the second
pass using the results of that to decide on the actual locations.
* Enum and array buttons now follow the direction of the layout, i.e.
they are vertical or horizontal depending if they are in a column or row.
* Color properties now get a color picker, and only get the additional
RGB sliders with Expand=True.
* File/directory string properties now get a button next to them for
opening the file browse, though this is not implemented yet.
* Layout items can now be aligned, set align=True when creating a column,
row, etc.
* Buttons now get a minimum width of one icon (avoids squashing icon
buttons).
* Moved some more space variables into Style.
2009-05-15 11:19:59 +00:00
|
|
|
ht->draw(C, &header);
|
2009-08-16 13:01:40 +00:00
|
|
|
|
|
|
|
/* for view2d */
|
2012-05-08 15:43:59 +00:00
|
|
|
xco = uiLayoutGetWidth(layout);
|
2012-03-24 06:38:07 +00:00
|
|
|
if (xco > maxco)
|
2012-05-08 15:43:59 +00:00
|
|
|
maxco = xco;
|
UI: Layout Engine
* Buttons are now created first, and after that the layout is computed.
This means the layout engine now works at button level, and makes it
easier to write templates. Otherwise you had to store all info and
create the buttons later.
* Added interface_templates.c as a separate file to put templates in.
These can contain regular buttons, and can be put in a Free layout,
which means you can specify manual coordinates, but still get nested
correct inside other layouts.
* API was changed to allow better nesting. Previously items were added
in the last added layout specifier, i.e. one level up in the layout
hierarchy. This doesn't work well in always, so now when creating things
like rows or columns it always returns a layout which you have to add
the items in. All py scripts were updated to follow this.
* Computing the layout now goes in two passes, first estimating the
required width/height of all nested layouts, and then in the second
pass using the results of that to decide on the actual locations.
* Enum and array buttons now follow the direction of the layout, i.e.
they are vertical or horizontal depending if they are in a column or row.
* Color properties now get a color picker, and only get the additional
RGB sliders with Expand=True.
* File/directory string properties now get a button next to them for
opening the file browse, though this is not implemented yet.
* Layout items can now be aligned, set align=True when creating a column,
row, etc.
* Buttons now get a minimum width of one icon (avoids squashing icon
buttons).
* Moved some more space variables into Style.
2009-05-15 11:19:59 +00:00
|
|
|
}
|
|
|
|
|
2014-11-09 21:20:40 +01:00
|
|
|
UI_block_layout_resolve(block, &xco, &yco);
|
2009-08-16 13:01:40 +00:00
|
|
|
|
|
|
|
/* for view2d */
|
2012-03-24 06:38:07 +00:00
|
|
|
if (xco > maxco)
|
2012-05-08 15:43:59 +00:00
|
|
|
maxco = xco;
|
2009-08-16 13:01:40 +00:00
|
|
|
|
2014-11-09 21:20:40 +01:00
|
|
|
UI_block_end(C, block);
|
|
|
|
UI_block_draw(C, block);
|
UI: Layout Engine
* Buttons are now created first, and after that the layout is computed.
This means the layout engine now works at button level, and makes it
easier to write templates. Otherwise you had to store all info and
create the buttons later.
* Added interface_templates.c as a separate file to put templates in.
These can contain regular buttons, and can be put in a Free layout,
which means you can specify manual coordinates, but still get nested
correct inside other layouts.
* API was changed to allow better nesting. Previously items were added
in the last added layout specifier, i.e. one level up in the layout
hierarchy. This doesn't work well in always, so now when creating things
like rows or columns it always returns a layout which you have to add
the items in. All py scripts were updated to follow this.
* Computing the layout now goes in two passes, first estimating the
required width/height of all nested layouts, and then in the second
pass using the results of that to decide on the actual locations.
* Enum and array buttons now follow the direction of the layout, i.e.
they are vertical or horizontal depending if they are in a column or row.
* Color properties now get a color picker, and only get the additional
RGB sliders with Expand=True.
* File/directory string properties now get a button next to them for
opening the file browse, though this is not implemented yet.
* Layout items can now be aligned, set align=True when creating a column,
row, etc.
* Buttons now get a minimum width of one icon (avoids squashing icon
buttons).
* Moved some more space variables into Style.
2009-05-15 11:19:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* always as last */
|
2012-10-25 12:53:27 +00:00
|
|
|
UI_view2d_totRect_set(&ar->v2d, maxco + UI_UNIT_X + 80, headery);
|
UI: Layout Engine
* Buttons are now created first, and after that the layout is computed.
This means the layout engine now works at button level, and makes it
easier to write templates. Otherwise you had to store all info and
create the buttons later.
* Added interface_templates.c as a separate file to put templates in.
These can contain regular buttons, and can be put in a Free layout,
which means you can specify manual coordinates, but still get nested
correct inside other layouts.
* API was changed to allow better nesting. Previously items were added
in the last added layout specifier, i.e. one level up in the layout
hierarchy. This doesn't work well in always, so now when creating things
like rows or columns it always returns a layout which you have to add
the items in. All py scripts were updated to follow this.
* Computing the layout now goes in two passes, first estimating the
required width/height of all nested layouts, and then in the second
pass using the results of that to decide on the actual locations.
* Enum and array buttons now follow the direction of the layout, i.e.
they are vertical or horizontal depending if they are in a column or row.
* Color properties now get a color picker, and only get the additional
RGB sliders with Expand=True.
* File/directory string properties now get a button next to them for
opening the file browse, though this is not implemented yet.
* Layout items can now be aligned, set align=True when creating a column,
row, etc.
* Buttons now get a minimum width of one icon (avoids squashing icon
buttons).
* Moved some more space variables into Style.
2009-05-15 11:19:59 +00:00
|
|
|
|
|
|
|
/* restore view matrix? */
|
|
|
|
UI_view2d_view_restore(C);
|
|
|
|
}
|
|
|
|
|
2009-05-19 17:13:33 +00:00
|
|
|
void ED_region_header_init(ARegion *ar)
|
|
|
|
{
|
|
|
|
UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_HEADER, ar->winx, ar->winy);
|
|
|
|
}
|
|
|
|
|
Code holiday commit:
- fix: user pref, window title was reset to 'Blender' on tab usage
- Undo history menu back:
- name "Undo History"
- hotkey alt+ctrl+z (alt+apple+z for mac)
- works like 2.4x, only for global undo, editmode and particle edit.
- Menu scroll
- for small windows or screens, popup menus now allow to display
all items, using internal scrolling
- works with a timer, scrolling 10 items per second when mouse
is over the top or bottom arrow
- if menu is too big to display, it now draws to top or bottom,
based on largest available space.
- also works for hotkey driven pop up menus.
- User pref "DPI" follows widget/layout size
- widgets & headers now become bigger and smaller, to match
'dpi' font sizes. Works well to match UI to monitor size.
- note that icons can get fuzzy, we need better mipmaps for it
2011-06-04 17:03:46 +00:00
|
|
|
/* UI_UNIT_Y is defined as U variable now, depending dpi */
|
|
|
|
int ED_area_headersize(void)
|
|
|
|
{
|
2013-09-04 03:52:25 +00:00
|
|
|
return (int)(HEADERY * UI_DPI_FAC);
|
Code holiday commit:
- fix: user pref, window title was reset to 'Blender' on tab usage
- Undo history menu back:
- name "Undo History"
- hotkey alt+ctrl+z (alt+apple+z for mac)
- works like 2.4x, only for global undo, editmode and particle edit.
- Menu scroll
- for small windows or screens, popup menus now allow to display
all items, using internal scrolling
- works with a timer, scrolling 10 items per second when mouse
is over the top or bottom arrow
- if menu is too big to display, it now draws to top or bottom,
based on largest available space.
- also works for hotkey driven pop up menus.
- User pref "DPI" follows widget/layout size
- widgets & headers now become bigger and smaller, to match
'dpi' font sizes. Works well to match UI to monitor size.
- note that icons can get fuzzy, we need better mipmaps for it
2011-06-04 17:03:46 +00:00
|
|
|
}
|
2011-11-30 06:03:10 +00:00
|
|
|
|
2013-04-14 21:42:58 +00:00
|
|
|
void ED_region_info_draw(ARegion *ar, const char *text, int block, float fill_color[4])
|
2011-11-30 06:03:10 +00:00
|
|
|
{
|
Holiday coding log :)
Nice formatted version (pictures soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.66/Usability
Short list of main changes:
- Transparent region option (over main region), added code to blend in/out such panels.
- Min size window now 640 x 480
- Fixed DPI for ui - lots of cleanup and changes everywhere. Icon image need correct size still, layer-in-use icon needs remake.
- Macbook retina support, use command line --no-native-pixels to disable it
- Timeline Marker label was drawing wrong
- Trackpad and magic mouse: supports zoom (hold ctrl)
- Fix for splash position: removed ghost function and made window size update after creation immediate
- Fast undo buffer save now adds UI as well. Could be checked for regular file save even...
Quit.blend and temp file saving use this now.
- Dixed filename in window on reading quit.blend or temp saves, and they now add a warning in window title: "(Recovered)"
- New Userpref option "Keep Session" - this always saves quit.blend, and loads on start.
This allows keeping UI and data without actual saves, until you actually save.
When you load startup.blend and quit, it recognises the quit.blend as a startup (no file name in header)
- Added 3D view copy/paste buffers (selected objects). Shortcuts ctrl-c, ctrl-v (OSX, cmd-c, cmd-v).
Coded partial file saving for it. Could be used for other purposes. Todo: use OS clipboards.
- User preferences (themes, keymaps, user settings) now can be saved as a separate file.
Old option is called "Save Startup File" the new one "Save User Settings".
To visualise this difference, the 'save startup file' button has been removed from user preferences window. That option is available as CTRL+U and in File menu still.
- OSX: fixed bug that stopped giving mouse events outside window.
This also fixes "Continuous Grab" for OSX. (error since 2009)
2012-12-12 18:58:11 +00:00
|
|
|
const int header_height = UI_UNIT_Y;
|
2014-11-09 21:20:40 +01:00
|
|
|
uiStyle *style = UI_style_get_dpi();
|
2012-05-08 15:43:59 +00:00
|
|
|
int fontid = style->widget.uifont_id;
|
2013-04-14 21:42:58 +00:00
|
|
|
GLint scissor[4];
|
2011-11-30 06:03:10 +00:00
|
|
|
rcti rect;
|
|
|
|
|
|
|
|
/* background box */
|
2012-12-18 13:59:47 +00:00
|
|
|
ED_region_visible_rect(ar, &rect);
|
2012-09-15 11:48:20 +00:00
|
|
|
rect.ymin = BLI_rcti_size_y(&ar->winrct) - header_height;
|
2011-11-30 06:03:10 +00:00
|
|
|
|
2013-01-23 14:05:08 +00:00
|
|
|
/* box fill entire width or just around text */
|
|
|
|
if (!block)
|
2013-12-02 20:33:45 +11:00
|
|
|
rect.xmax = min_ii(rect.xmax, rect.xmin + BLF_width(fontid, text, BLF_DRAW_STR_DUMMY_MAX) + 1.2f * U.widget_unit);
|
2011-11-30 06:03:10 +00:00
|
|
|
|
2012-09-15 11:48:20 +00:00
|
|
|
rect.ymax = BLI_rcti_size_y(&ar->winrct);
|
2011-11-30 06:03:10 +00:00
|
|
|
|
2013-04-14 21:42:58 +00:00
|
|
|
/* setup scissor */
|
|
|
|
glGetIntegerv(GL_SCISSOR_BOX, scissor);
|
|
|
|
glScissor(ar->winrct.xmin + rect.xmin, ar->winrct.ymin + rect.ymin,
|
2013-04-15 16:18:33 +00:00
|
|
|
BLI_rcti_size_x(&rect) + 1, BLI_rcti_size_y(&rect) + 1);
|
2013-04-14 21:42:58 +00:00
|
|
|
|
2011-11-30 06:03:10 +00:00
|
|
|
glEnable(GL_BLEND);
|
2012-04-29 15:47:02 +00:00
|
|
|
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
2013-04-14 21:42:58 +00:00
|
|
|
glColor4fv(fill_color);
|
2012-05-08 15:43:59 +00:00
|
|
|
glRecti(rect.xmin, rect.ymin, rect.xmax + 1, rect.ymax + 1);
|
2011-11-30 06:03:10 +00:00
|
|
|
glDisable(GL_BLEND);
|
|
|
|
|
|
|
|
/* text */
|
|
|
|
UI_ThemeColor(TH_TEXT_HI);
|
2013-01-23 14:05:08 +00:00
|
|
|
BLF_clipping(fontid, rect.xmin, rect.ymin, rect.xmax, rect.ymax);
|
|
|
|
BLF_enable(fontid, BLF_CLIPPING);
|
2013-01-23 23:42:18 +00:00
|
|
|
BLF_position(fontid, rect.xmin + 0.6f * U.widget_unit, rect.ymin + 0.3f * U.widget_unit, 0.0f);
|
2013-01-23 14:05:08 +00:00
|
|
|
|
2012-01-11 12:33:51 +00:00
|
|
|
BLF_draw(fontid, text, BLF_DRAW_STR_DUMMY_MAX);
|
2013-01-23 14:05:08 +00:00
|
|
|
|
|
|
|
BLF_disable(fontid, BLF_CLIPPING);
|
2013-04-14 21:42:58 +00:00
|
|
|
|
|
|
|
/* restore scissor as it was before */
|
|
|
|
glScissor(scissor[0], scissor[1], scissor[2], scissor[3]);
|
2011-11-30 06:03:10 +00:00
|
|
|
}
|
2012-04-28 10:09:58 +00:00
|
|
|
|
2015-04-20 19:57:57 +02:00
|
|
|
#define MAX_METADATA_STR 1024
|
|
|
|
|
2015-05-05 05:17:25 +10:00
|
|
|
static const char *meta_data_list[] =
|
2015-04-20 19:57:57 +02:00
|
|
|
{
|
|
|
|
"File",
|
|
|
|
"Strip",
|
|
|
|
"Note",
|
|
|
|
"Date",
|
|
|
|
"RenderTime",
|
|
|
|
"Marker",
|
|
|
|
"Time",
|
|
|
|
"Frame",
|
|
|
|
"Camera",
|
|
|
|
"Scene"
|
|
|
|
};
|
|
|
|
|
2015-04-21 17:15:40 +02:00
|
|
|
BLI_INLINE bool metadata_is_valid(ImBuf *ibuf, char *r_str, short index, int offset)
|
2015-04-20 19:57:57 +02:00
|
|
|
{
|
2015-04-21 17:15:40 +02:00
|
|
|
return (IMB_metadata_get_field(ibuf, meta_data_list[index], r_str + offset, MAX_METADATA_STR - offset) && r_str[0]);
|
2015-04-20 19:57:57 +02:00
|
|
|
}
|
|
|
|
|
2015-06-30 15:31:55 +10:00
|
|
|
static void metadata_draw_imbuf(ImBuf *ibuf, const rctf *rect, int fontid, const bool is_top)
|
2015-04-20 19:57:57 +02:00
|
|
|
{
|
|
|
|
char temp_str[MAX_METADATA_STR];
|
2015-04-22 04:43:13 +10:00
|
|
|
int line_width;
|
2015-04-20 19:57:57 +02:00
|
|
|
int ofs_y = 0;
|
|
|
|
short i;
|
2015-04-21 17:15:40 +02:00
|
|
|
int len;
|
2015-04-22 04:43:13 +10:00
|
|
|
const float height = BLF_height_max(fontid);
|
2015-05-01 14:27:44 +02:00
|
|
|
const float vertical_offset = height + (0.1f * U.widget_unit);
|
2015-04-20 19:57:57 +02:00
|
|
|
|
2015-04-21 17:15:40 +02:00
|
|
|
if (is_top) {
|
|
|
|
for (i = 0; i < 4; i++) {
|
|
|
|
/* first line */
|
|
|
|
if (i == 0) {
|
|
|
|
bool do_newline = false;
|
2015-04-22 05:37:22 +10:00
|
|
|
len = BLI_snprintf_rlen(temp_str, MAX_METADATA_STR, "%s: ", meta_data_list[0]);
|
2015-04-21 17:15:40 +02:00
|
|
|
if (metadata_is_valid(ibuf, temp_str, 0, len)) {
|
2015-06-30 15:31:55 +10:00
|
|
|
BLF_position(fontid, rect->xmin + (0.2f * U.widget_unit),
|
|
|
|
rect->ymax - vertical_offset, 0.0f);
|
2015-04-21 17:15:40 +02:00
|
|
|
BLF_draw(fontid, temp_str, BLF_DRAW_STR_DUMMY_MAX);
|
|
|
|
do_newline = true;
|
|
|
|
}
|
2015-04-20 19:57:57 +02:00
|
|
|
|
2015-04-22 05:37:22 +10:00
|
|
|
len = BLI_snprintf_rlen(temp_str, MAX_METADATA_STR, "%s: ", meta_data_list[1]);
|
2015-04-21 17:15:40 +02:00
|
|
|
if (metadata_is_valid(ibuf, temp_str, 1, len)) {
|
2015-04-22 04:43:13 +10:00
|
|
|
line_width = BLF_width(fontid, temp_str, BLF_DRAW_STR_DUMMY_MAX);
|
2015-06-30 15:31:55 +10:00
|
|
|
BLF_position(fontid, rect->xmax - line_width - (0.2f * U.widget_unit),
|
|
|
|
rect->ymax - vertical_offset, 0.0f);
|
2015-04-21 17:15:40 +02:00
|
|
|
BLF_draw(fontid, temp_str, BLF_DRAW_STR_DUMMY_MAX);
|
|
|
|
do_newline = true;
|
|
|
|
}
|
2015-04-20 19:57:57 +02:00
|
|
|
|
2015-04-21 17:15:40 +02:00
|
|
|
if (do_newline)
|
2015-05-01 14:27:44 +02:00
|
|
|
ofs_y += vertical_offset;
|
2015-04-20 19:57:57 +02:00
|
|
|
}
|
2015-04-21 17:15:40 +02:00
|
|
|
else if (i == 1) {
|
2015-04-22 05:37:22 +10:00
|
|
|
len = BLI_snprintf_rlen(temp_str, MAX_METADATA_STR, "%s: ", meta_data_list[i + 1]);
|
2015-04-21 17:15:40 +02:00
|
|
|
if (metadata_is_valid(ibuf, temp_str, i + 1, len)) {
|
2015-06-30 15:31:55 +10:00
|
|
|
BLF_position(fontid, rect->xmin + (0.2f * U.widget_unit),
|
|
|
|
rect->ymax - vertical_offset - ofs_y, 0.0f);
|
2015-04-21 17:15:40 +02:00
|
|
|
BLF_draw(fontid, temp_str, BLF_DRAW_STR_DUMMY_MAX);
|
2015-05-01 14:27:44 +02:00
|
|
|
ofs_y += vertical_offset;
|
2015-04-21 17:15:40 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
2015-04-22 05:37:22 +10:00
|
|
|
len = BLI_snprintf_rlen(temp_str, MAX_METADATA_STR, "%s: ", meta_data_list[i + 1]);
|
2015-04-21 17:15:40 +02:00
|
|
|
if (metadata_is_valid(ibuf, temp_str, i + 1, len)) {
|
2015-04-22 13:19:58 +02:00
|
|
|
line_width = BLF_width(fontid, temp_str, BLF_DRAW_STR_DUMMY_MAX);
|
2015-06-30 15:31:55 +10:00
|
|
|
BLF_position(fontid, rect->xmax - line_width - (0.2f * U.widget_unit),
|
|
|
|
rect->ymax - vertical_offset - ofs_y, 0.0f);
|
2015-04-21 17:15:40 +02:00
|
|
|
BLF_draw(fontid, temp_str, BLF_DRAW_STR_DUMMY_MAX);
|
2015-05-01 14:27:44 +02:00
|
|
|
ofs_y += vertical_offset;
|
2015-04-21 17:15:40 +02:00
|
|
|
}
|
2015-04-20 19:57:57 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2015-04-21 17:15:40 +02:00
|
|
|
else {
|
2015-04-20 19:57:57 +02:00
|
|
|
int ofs_x = 0;
|
|
|
|
for (i = 5; i < 10; i++) {
|
2015-04-22 05:37:22 +10:00
|
|
|
len = BLI_snprintf_rlen(temp_str, MAX_METADATA_STR, "%s: ", meta_data_list[i]);
|
2015-04-21 17:15:40 +02:00
|
|
|
if (metadata_is_valid(ibuf, temp_str, i, len)) {
|
2015-06-30 15:31:55 +10:00
|
|
|
BLF_position(fontid, rect->xmin + (0.2f * U.widget_unit) + ofs_x,
|
|
|
|
rect->ymin + (0.3f * U.widget_unit), 0.0f);
|
2015-04-20 19:57:57 +02:00
|
|
|
BLF_draw(fontid, temp_str, BLF_DRAW_STR_DUMMY_MAX);
|
|
|
|
|
2015-04-22 04:43:13 +10:00
|
|
|
ofs_x += BLF_width(fontid, temp_str, BLF_DRAW_STR_DUMMY_MAX) + UI_UNIT_X;
|
2015-04-20 19:57:57 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static float metadata_box_height_get(ImBuf *ibuf, int fontid, const bool is_top)
|
|
|
|
{
|
2015-05-14 23:58:08 +02:00
|
|
|
char str[MAX_METADATA_STR] = "";
|
2015-04-22 13:19:58 +02:00
|
|
|
short i, count = 0;
|
2015-05-01 14:27:44 +02:00
|
|
|
const float height = BLF_height_max(fontid) + 0.1f * U.widget_unit;
|
2015-04-20 19:57:57 +02:00
|
|
|
|
|
|
|
if (is_top) {
|
2015-04-22 13:19:58 +02:00
|
|
|
if (metadata_is_valid(ibuf, str, 0, 0) || metadata_is_valid(ibuf, str, 1, 0)) {
|
|
|
|
count++;
|
|
|
|
}
|
|
|
|
for (i = 2; i < 5; i++) {
|
2015-04-21 17:15:40 +02:00
|
|
|
if (metadata_is_valid(ibuf, str, i, 0)) {
|
2015-04-22 13:19:58 +02:00
|
|
|
count++;
|
2015-04-20 19:57:57 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
for (i = 5; i < 10; i++) {
|
2015-04-21 17:15:40 +02:00
|
|
|
if (metadata_is_valid(ibuf, str, i, 0)) {
|
2015-04-22 13:19:58 +02:00
|
|
|
count = 1;
|
2015-04-20 19:57:57 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-04-22 13:19:58 +02:00
|
|
|
if (count) {
|
2015-05-01 14:27:44 +02:00
|
|
|
return (height * count + (0.1f * U.widget_unit));
|
2015-04-20 19:57:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
#undef MAX_METADATA_STR
|
|
|
|
|
2015-05-04 12:17:49 +02:00
|
|
|
void ED_region_image_metadata_draw(int x, int y, ImBuf *ibuf, rctf frame, float zoomx, float zoomy)
|
2015-04-20 19:57:57 +02:00
|
|
|
{
|
|
|
|
float box_y;
|
2015-05-04 12:17:49 +02:00
|
|
|
rctf rect;
|
2015-05-01 14:27:44 +02:00
|
|
|
uiStyle *style = UI_style_get_dpi();
|
2015-04-20 19:57:57 +02:00
|
|
|
|
|
|
|
if (!ibuf->metadata)
|
|
|
|
return;
|
|
|
|
|
|
|
|
/* find window pixel coordinates of origin */
|
|
|
|
glPushMatrix();
|
|
|
|
|
|
|
|
/* offset and zoom using ogl */
|
|
|
|
glTranslatef(x, y, 0.0f);
|
|
|
|
glScalef(zoomx, zoomy, 1.0f);
|
|
|
|
|
2015-05-04 12:30:26 +02:00
|
|
|
BLF_size(blf_mono_font, style->widgetlabel.points * 1.5f, U.dpi);
|
2015-04-21 17:15:40 +02:00
|
|
|
|
2015-04-20 19:57:57 +02:00
|
|
|
/* *** upper box*** */
|
|
|
|
|
|
|
|
/* get needed box height */
|
2015-05-01 14:27:44 +02:00
|
|
|
box_y = metadata_box_height_get(ibuf, blf_mono_font, true);
|
2015-04-20 19:57:57 +02:00
|
|
|
|
|
|
|
if (box_y) {
|
2015-04-21 17:15:40 +02:00
|
|
|
UI_ThemeColor(TH_METADATA_BG);
|
2015-04-20 19:57:57 +02:00
|
|
|
|
|
|
|
/* set up rect */
|
2015-05-04 12:17:49 +02:00
|
|
|
BLI_rctf_init(&rect, frame.xmin, frame.xmax, frame.ymax, frame.ymax + box_y);
|
2015-04-20 19:57:57 +02:00
|
|
|
/* draw top box */
|
2015-05-04 12:17:49 +02:00
|
|
|
glRectf(rect.xmin, rect.ymin, rect.xmax, rect.ymax);
|
2015-04-20 19:57:57 +02:00
|
|
|
|
2015-05-01 14:27:44 +02:00
|
|
|
BLF_clipping(blf_mono_font, rect.xmin, rect.ymin, rect.xmax, rect.ymax);
|
|
|
|
BLF_enable(blf_mono_font, BLF_CLIPPING);
|
2015-04-20 19:57:57 +02:00
|
|
|
|
2015-04-21 19:01:09 +02:00
|
|
|
UI_ThemeColor(TH_METADATA_TEXT);
|
2015-06-30 15:31:55 +10:00
|
|
|
metadata_draw_imbuf(ibuf, &rect, blf_mono_font, true);
|
2015-04-20 19:57:57 +02:00
|
|
|
|
2015-05-01 14:27:44 +02:00
|
|
|
BLF_disable(blf_mono_font, BLF_CLIPPING);
|
2015-04-20 19:57:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* *** lower box*** */
|
|
|
|
|
2015-05-01 14:27:44 +02:00
|
|
|
box_y = metadata_box_height_get(ibuf, blf_mono_font, false);
|
2015-04-20 19:57:57 +02:00
|
|
|
|
|
|
|
if (box_y) {
|
2015-04-21 17:15:40 +02:00
|
|
|
UI_ThemeColor(TH_METADATA_BG);
|
2015-04-20 19:57:57 +02:00
|
|
|
|
|
|
|
/* set up box rect */
|
2015-05-04 12:17:49 +02:00
|
|
|
BLI_rctf_init(&rect, frame.xmin, frame.xmax, frame.ymin - box_y, frame.ymin);
|
2015-04-20 19:57:57 +02:00
|
|
|
/* draw top box */
|
2015-05-04 12:17:49 +02:00
|
|
|
glRectf(rect.xmin, rect.ymin, rect.xmax, rect.ymax);
|
2015-04-20 19:57:57 +02:00
|
|
|
|
2015-05-01 14:27:44 +02:00
|
|
|
BLF_clipping(blf_mono_font, rect.xmin, rect.ymin, rect.xmax, rect.ymax);
|
|
|
|
BLF_enable(blf_mono_font, BLF_CLIPPING);
|
2015-04-20 19:57:57 +02:00
|
|
|
|
2015-04-21 19:01:09 +02:00
|
|
|
UI_ThemeColor(TH_METADATA_TEXT);
|
2015-06-30 15:31:55 +10:00
|
|
|
metadata_draw_imbuf(ibuf, &rect, blf_mono_font, false);
|
2015-04-20 19:57:57 +02:00
|
|
|
|
2015-05-01 14:27:44 +02:00
|
|
|
BLF_disable(blf_mono_font, BLF_CLIPPING);
|
2015-04-20 19:57:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
glPopMatrix();
|
|
|
|
}
|
|
|
|
|
2012-04-28 10:09:58 +00:00
|
|
|
void ED_region_grid_draw(ARegion *ar, float zoomx, float zoomy)
|
|
|
|
{
|
|
|
|
float gridsize, gridstep = 1.0f / 32.0f;
|
|
|
|
float fac, blendfac;
|
|
|
|
int x1, y1, x2, y2;
|
|
|
|
|
2012-04-29 15:47:02 +00:00
|
|
|
/* the image is located inside (0, 0), (1, 1) as set by view2d */
|
2012-04-28 10:09:58 +00:00
|
|
|
UI_ThemeColorShade(TH_BACK, 20);
|
|
|
|
|
2014-04-21 16:47:16 +10:00
|
|
|
UI_view2d_view_to_region(&ar->v2d, 0.0f, 0.0f, &x1, &y1);
|
|
|
|
UI_view2d_view_to_region(&ar->v2d, 1.0f, 1.0f, &x2, &y2);
|
2012-04-28 10:09:58 +00:00
|
|
|
glRectf(x1, y1, x2, y2);
|
|
|
|
|
|
|
|
/* gridsize adapted to zoom level */
|
|
|
|
gridsize = 0.5f * (zoomx + zoomy);
|
|
|
|
if (gridsize <= 0.0f)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (gridsize < 1.0f) {
|
|
|
|
while (gridsize < 1.0f) {
|
|
|
|
gridsize *= 4.0f;
|
|
|
|
gridstep *= 4.0f;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
while (gridsize >= 4.0f) {
|
|
|
|
gridsize /= 4.0f;
|
|
|
|
gridstep /= 4.0f;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* the fine resolution level */
|
|
|
|
blendfac = 0.25f * gridsize - floorf(0.25f * gridsize);
|
|
|
|
CLAMP(blendfac, 0.0f, 1.0f);
|
|
|
|
UI_ThemeColorShade(TH_BACK, (int)(20.0f * (1.0f - blendfac)));
|
|
|
|
|
|
|
|
fac = 0.0f;
|
|
|
|
glBegin(GL_LINES);
|
|
|
|
while (fac < 1.0f) {
|
|
|
|
glVertex2f(x1, y1 * (1.0f - fac) + y2 * fac);
|
|
|
|
glVertex2f(x2, y1 * (1.0f - fac) + y2 * fac);
|
|
|
|
glVertex2f(x1 * (1.0f - fac) + x2 * fac, y1);
|
|
|
|
glVertex2f(x1 * (1.0f - fac) + x2 * fac, y2);
|
|
|
|
fac += gridstep;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* the large resolution level */
|
|
|
|
UI_ThemeColor(TH_BACK);
|
|
|
|
|
|
|
|
fac = 0.0f;
|
|
|
|
while (fac < 1.0f) {
|
|
|
|
glVertex2f(x1, y1 * (1.0f - fac) + y2 * fac);
|
|
|
|
glVertex2f(x2, y1 * (1.0f - fac) + y2 * fac);
|
|
|
|
glVertex2f(x1 * (1.0f - fac) + x2 * fac, y1);
|
|
|
|
glVertex2f(x1 * (1.0f - fac) + x2 * fac, y2);
|
|
|
|
fac += 4.0f * gridstep;
|
|
|
|
}
|
|
|
|
glEnd();
|
|
|
|
}
|
2012-12-16 09:37:15 +00:00
|
|
|
|
2012-12-18 13:59:47 +00:00
|
|
|
/* If the area has overlapping regions, it returns visible rect for Region *ar */
|
|
|
|
/* rect gets returned in local region coordinates */
|
|
|
|
void ED_region_visible_rect(ARegion *ar, rcti *rect)
|
2012-12-16 09:37:15 +00:00
|
|
|
{
|
|
|
|
ARegion *arn = ar;
|
|
|
|
|
2012-12-18 13:59:47 +00:00
|
|
|
/* allow function to be called without area */
|
2012-12-16 09:37:15 +00:00
|
|
|
while (arn->prev)
|
|
|
|
arn = arn->prev;
|
|
|
|
|
2012-12-18 13:59:47 +00:00
|
|
|
*rect = ar->winrct;
|
|
|
|
|
2012-12-16 09:37:15 +00:00
|
|
|
/* check if a region overlaps with the current one */
|
|
|
|
for (; arn; arn = arn->next) {
|
2012-12-18 13:59:47 +00:00
|
|
|
if (ar != arn && arn->overlap) {
|
|
|
|
if (BLI_rcti_isect(rect, &arn->winrct, NULL)) {
|
2013-02-23 14:31:46 +00:00
|
|
|
|
|
|
|
/* overlap left, also check 1 pixel offset (2 regions on one side) */
|
2013-02-24 20:33:21 +00:00
|
|
|
if (ABS(rect->xmin - arn->winrct.xmin) < 2)
|
2012-12-18 13:59:47 +00:00
|
|
|
rect->xmin = arn->winrct.xmax;
|
2013-02-23 14:31:46 +00:00
|
|
|
|
2012-12-18 13:59:47 +00:00
|
|
|
/* overlap right */
|
2013-02-24 20:33:21 +00:00
|
|
|
if (ABS(rect->xmax - arn->winrct.xmax) < 2)
|
2012-12-18 13:59:47 +00:00
|
|
|
rect->xmax = arn->winrct.xmin;
|
|
|
|
}
|
|
|
|
}
|
2012-12-16 09:37:15 +00:00
|
|
|
}
|
2012-12-18 13:59:47 +00:00
|
|
|
BLI_rcti_translate(rect, -ar->winrct.xmin, -ar->winrct.ymin);
|
2012-12-16 09:37:15 +00:00
|
|
|
}
|
|
|
|
|
2014-04-02 16:50:06 +06:00
|
|
|
/* Cache display helpers */
|
|
|
|
|
|
|
|
void ED_region_cache_draw_background(const ARegion *ar)
|
|
|
|
{
|
|
|
|
glColor4ub(128, 128, 255, 64);
|
|
|
|
glRecti(0, 0, ar->winx, 8 * UI_DPI_FAC);
|
|
|
|
}
|
|
|
|
|
|
|
|
void ED_region_cache_draw_curfra_label(const int framenr, const float x, const float y)
|
|
|
|
{
|
2014-11-09 21:20:40 +01:00
|
|
|
uiStyle *style = UI_style_get();
|
2014-04-02 16:50:06 +06:00
|
|
|
int fontid = style->widget.uifont_id;
|
|
|
|
char numstr[32];
|
|
|
|
float font_dims[2] = {0.0f, 0.0f};
|
|
|
|
|
|
|
|
/* frame number */
|
|
|
|
BLF_size(fontid, 11.0f * U.pixelsize, U.dpi);
|
|
|
|
BLI_snprintf(numstr, sizeof(numstr), "%d", framenr);
|
|
|
|
|
|
|
|
BLF_width_and_height(fontid, numstr, sizeof(numstr), &font_dims[0], &font_dims[1]);
|
|
|
|
|
|
|
|
glRecti(x, y, x + font_dims[0] + 6.0f, y + font_dims[1] + 4.0f);
|
|
|
|
|
|
|
|
UI_ThemeColor(TH_TEXT);
|
|
|
|
BLF_position(fontid, x + 2.0f, y + 2.0f, 0.0f);
|
|
|
|
BLF_draw(fontid, numstr, sizeof(numstr));
|
|
|
|
}
|
|
|
|
|
|
|
|
void ED_region_cache_draw_cached_segments(const ARegion *ar, const int num_segments, const int *points, const int sfra, const int efra)
|
|
|
|
{
|
|
|
|
if (num_segments) {
|
|
|
|
int a;
|
|
|
|
|
|
|
|
glColor4ub(128, 128, 255, 128);
|
|
|
|
|
|
|
|
for (a = 0; a < num_segments; a++) {
|
|
|
|
float x1, x2;
|
|
|
|
|
|
|
|
x1 = (float)(points[a * 2] - sfra) / (efra - sfra + 1) * ar->winx;
|
|
|
|
x2 = (float)(points[a * 2 + 1] - sfra + 1) / (efra - sfra + 1) * ar->winx;
|
|
|
|
|
|
|
|
glRecti(x1, 0, x2, 8 * UI_DPI_FAC);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|