Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-09-09Cleanup: reduce variable scopeJacques Lucke
2020-08-26Cleanup: use const variables in interface codeCampbell Barton
2020-08-20GPU: Fix some more remaining GL enums scattered outside of GL moduleClément Foucault
This fixes an assert inside the lasso selection drawing.
2020-08-19UI Code Quality: Use LISTBASE_FOREACH in interface directoryHans Goudey
I only skipped a few loops in the monstrous ui_handle_menu_event function. Also, I only changed variable names where necessary to prevent redeclarations. Differential Revision: https://developer.blender.org/D8586
2020-08-18Cleanup: GPUState: remove double GPU_blend callsClément Foucault
2020-08-18GPUState: GPU_blend final API renamingClément Foucault
We now use GPU_blend for enabling / disabling blending and explicitly set the blend equation.
2020-08-18Cleanup: GPUState: Replace blend func separate by enumClément Foucault
2020-08-18Cleanup: GPU: Replace Batch uniform by shader uniform using macroClément Foucault
This is a first step into removing uniforms from GPU_batch and Imm.
2020-08-13GPUBatch: Remove most use of GPU_batch_draw_advanced()Clément Foucault
This is in order to better encapsulate / isolate the drawing code.
2020-08-13GPUShader: Change shader state tracking to be part of the GPUContextClément Foucault
This remove the use of batch->program and replace it with batch->shader. This will allow GL abstraction latter.
2020-08-07UI Code Quality: Use derived struct for HSV Cube buttonsJulian Eisel
For the main rationale behind this design, see 49f088e2d093. Further, this removes users of uiBut.a1, which is a very ugly design choice (hard to reason about). Part of T74432.
2020-08-07UI Code Quality: Use derived struct for progessbar buttonsJulian Eisel
For the main rationale behind this design, see 03b122e2a18df. Further, this removes users of `uiBut.a1`, which is a very ugly design choice (hard to reason about). Part of T74432.
2020-08-07UI Code Quality: Use derived struct for color buttonsJulian Eisel
For the main rationale behind this design, see 03b122e2a18df. Further, this removes users of `uiBut.a1`/`uiBut.a2`, which is a very ugly design choice (hard to reason about). Part of Part of T74432.
2020-08-07UI Code Quality: Use derived structs for search buttons and decoratorsJulian Eisel
The current on-size-fits-all `uiBut` creates quite a mess, where it's hard to reason about which members are free for use, under which conditions they are used and how. `uiBut` also has members that aren't used at times, violating the "don't pay for what you don't use" principle. To address this, we want to move to typed buttons, where `uiBut` is just a base struct and each type extends it as needed. That structures data better and type specific data is only available if it's actually used by a button type. Two trade-offs: * Many casts to the derived type have to be done. * Sometimes we change the button type after it's created. So I had to add logic to reallocate the button for use with the new, possibly derived struct. Ideally that wouldn't be needed, but for now that's what we have. Part of T74432. Differential Revision: https://developer.blender.org/D7610 Reviewed by: Brecht Van Lommel, Campbell Barton
2020-08-07Cleanup: declare arrays arrays where possibleCampbell Barton
2020-08-06Merge branch 'blender-v2.90-release'Julian Eisel
2020-08-06Fix padding when multi-editing aligned widgetsRed Mser
Similar to T58668, labels were not aligned when multi-editing widgets that are not center-aligned. Reviewed by: Hans Goudey, Julian Eisel Differential Revision: https://developer.blender.org/D8441
2020-08-05Merge branch 'blender-v2.90-release'Julian Eisel
2020-08-05Fix T78630: Custom icons not grayed out in inactive layoutsJulian Eisel
For regular icons this worked because they used the text color, which was already grayed out by the caller.
2020-08-03Merge branch 'blender-v2.90-release'Julian Eisel
2020-08-03Fix T78428: Checkbox labels don't highlight on mouse-over in popoversJulian Eisel
The text colors set by the general widget state function (`widget_state()`) would always be overriden by the menu-back text colors to avoid contrast issues. This would only respect the selected state, not other states. Address this now by changing the input theme colors to use the menu-back ones, rather than overriding after the fact (calling `widget_state()`).
2020-07-29Cleanup: rename uiBut.dt, uiBlock.dt to 'emboss'Campbell Barton
Use 'emboss' instead of 'draw_type' as enum, layout & functions use the term emboss. This issue was noted by @Poulpator in D8414, as `dt` is also an abbreviation for delta-time.
2020-07-24Fix interface artifacts on Intel GPUsSergey Sharybin
This is a continuation of fix for T78307. Turns out instancing do not work at all, so enforce single widget drawing on macOS and Intel GPU. It was also reported that certain AMD and Mesa driver suffer from similar issue, so disabled instancing for this configuration as well. Differential Revision: https://developer.blender.org/D8374
2020-07-10Cleanup: spellingCampbell Barton
2020-07-03Clang-Tidy: Enable bugprone-misplaced-widening-castSergey Sharybin
2020-06-22UI: Widget: Replace geometry by fragment shader drawingClément Foucault
This means all the antiailasing is done inside the fragment shader. We use a Signed Distance Field to draw the 2D rounded boxes. This ensure the best quality for AA. This reduce the averge Batch for widget to 16 verts instead of ~600 and reduce overshading a lot. Theme Emboss alpha and tria alpha needs to be changed after this refactor. The shadow drawing is left unchanged and still use geometry. Reviewed By: Severin Differential Revision: https://developer.blender.org/D7833
2020-05-26UI: List Panel SystemHans Goudey
This implements a general system to implement drag and drop, subpanels, and UI animation for the stack UIs in Blender. There are NO functional changes in this patch, but it makes it relatively trivial to implement these features for stacks. The biggest complication to using panels to implement the UI for lists is that there can be multiple modifiers of the same type. Currently there is an assumed 1 to 1 relationship between every panel and its type, but there can be multiple list items of the same type, so we have to break this relationship. The mapping between panels and their data is stored with an index in the panel's runtime struct. To make use the system for a list like modifiers, four components must be added: 1. A panel type defined and registered for each list data type, with a known mapping between list data types and panel idnames. 1. A function called by interface code to build the add the panel layouts with the provided helper functions. - UI_panel_list_matches_data will check if the panel list needs to be rebuilt. - UI_panels_free_instanced will remove the existing list panels - UI_panel_add_instanced adds a list panel of a given type. 3. An expand flag for the list data and implementations of get_list_data_expand_flag and set_list_data_expand_flag. 4. For reordering, the panel type's reorder callback. This is called when the instanced panels are drag-dropped. This requires implementing a "move to index" operator for the list data. Reviewed By: Severin, brecht Differential Revision: https://developer.blender.org/D7490
2020-05-12Merge branch 'blender-v2.83-release'Campbell Barton
2020-05-12Cleanup: remove DNA_screen_types.h, use struct qualifierCampbell Barton
Also remove draw-manager & depsgraph headers in interface_icons.c Change this in 2.83 to prevent merge issues in master with interface_intern.h header.
2020-05-05UI: Gray out shortcut indicator in search menusJulian Eisel
In other menus we already gray out the shortcut string, just in the search menu that wasn't the case. We may also want to draw other hints like this in the future, e.g. the library name for linked data-blocks in search menus. And then it's also nicer to have it grayed out to separate it visually from the data-block name.
2020-05-03BLF: use 'int' for internal glyph x,y bearingCampbell Barton
These were stored as float but were originally cast from an int and were often cast back to int. Also use int pairs for dimensions values.
2020-05-03UI: improve widget text cursor positionHarley Acheson
Use BLF_boundbox_foreach_glyph for more accurate cursor placement.
2020-05-03BLF: add new arguments to BLF_GlyphBoundsFnCampbell Barton
- glyph_bounds: to get the character width. - glyph_bearing: lower left character starting point. These values are needed for more precise glyph calculations.
2020-04-28Merge branch 'blender-v2.83-release'Campbell Barton
2020-04-28Fix T76152: Shortcut underline under wrong letterCampbell Barton
Use glyph bounds to calculate a better underline position.
2020-04-17UI: Better split layout support for checkboxesJulian Eisel
Makes the following layout changes possible: {F8473498} {F8473499} {F8473502} The next commit will contain many layout changes to make good use of these new possibilities. The result should be more consistent, easier to read and should give a more organized impression. Additionally, it should be possible to replace many sub-panels with compacter layouts. Main changes: * Checkboxes now respect the property split layouts * Add support for row and column headers (i.e. `uiLayout.column(heading="Foo")`, `uiLayout.row(heading="Bar")`). If the first property added to this layout doesn't insert anything into the label split column, the heading is inserted there. Otherwise, it's inserted as own item. * Add support for manually inserting decorators for an existing item (`uiLayout.prop_decorator()`). That way layout creators can manually insert this, which was the only way I saw to support property split layouts with a checkbox before the actual property. {F8471883} * Autogenerated layouts for operator properties look bad if there are only checkboxes (which only use half the region width). So before creating the layout, we iterate over visible properties and disable split layout if all are booleans. I think this is fine, if needed we could also add layout hints to operators. * `uiTemplateOperatorPropertyButs()` now handles macros itself, the caller used to be responsible for this. Code that didn't handle these so far never used macros I think, so this change should be invisible. * Remove manual property split layout from autogenerated operator properties layout. * Padding of checkboxes is tweaked to make their label visually more connected to the checkboxes. * Support split layout for menus (should work for `uiLayout.menu()`, `.operator_menu_enum()`, `.prop_menu_enum()`, maybe more) Maniphest Task: https://developer.blender.org/T65965 Differential Revision: https://developer.blender.org/D7427 Reviewed by: Brecht Van Lommel, William Reynish, Pablo Vazques
2020-04-17Cleanup: comments for ui_draw_menu_item & correct argument nameCampbell Barton
2020-04-16UI: Draw real node sockets for node input buttonsJulian Eisel
For buttons representing node inputs (e.g. in the material properties) rather than drawing some generic socket icon, the actual sockets are drawn now. That includes color, shape and the selection outline. This should make it easier to understand what these buttons relate to. Screenshots: {F8469252}, {F8469248} (The left alignment will be done in a follow-up commit.) Differential Revision: https://developer.blender.org/D7409 Reviewed by: Brecht Van Lommel, Clément Foucault, William Reynish
2020-04-15Fix incorrect UI_SEP_CHAR checksCampbell Barton
- Menu drawing function used first instance instead of last. - Menu hash function checked for the character without first checking UI_BUT_HAS_SEP_CHAR was enabled.
2020-04-14GPUShader: Implement workaround for gizmo drawing on sRGB framebufferClément Foucault
This solution involves adding a uniform to each fragment shader that is used by gizmo drawing and use the framebuffer state to set this uniform accordingly. This solution can also be carried to external shaders (addons). A single line of code would then be enough to fix the issue. The only trickery here is the dummy define: `#define srgb_to_framebuffer_space(a)` This is in order to avoid breaking other DRW shaders that use the same fragment shader code but do not need the tranformation. Related to T74139 Reviewed By: brecht, campbellbarton Differential Revision: https://developer.blender.org/D7261
2020-04-14Fix showing check-boxes in menu-searchCampbell Barton
2020-04-14UI: improve menu search with dimmed menu prefixCampbell Barton
- Show dimmed text for the menu entries leading up to the menu item. - Show icons between the menu text and menu item. - Use unicode right pointing triangle instead of arrow.
2020-04-14Cleanup: pass font drawing x/y offset arguments as int'sCampbell Barton
Internally these values are ints.
2020-03-29UI: Fix text padding for labels without an iconYevgeny Makarov
2020-03-19Cleanup: `make format` after SortedIncludes changeDalai Felinto
2020-03-16UI: Add an Outline to the Popover ArrowsYevgeny Makarov
Reviewed By: billreynish, fclem Differential Revision: https://developer.blender.org/D5873
2020-03-15Cleanup: use 'const' style argumentCampbell Barton
2020-03-06Cleanup: Rename ARegion variables from ar to regionJulian Eisel
The old convention was easy to confuse with ScrArea. Part of https://developer.blender.org/T74432. This is mostly a batch rename with some manual fixing. Only single word variable names are changed, no prefixed/suffixed names. Brecht van Lommel and Campbell Barton both gave me a green light for this convention change. Also ran clan clang format on affected files.
2020-02-28Fix T65351: visual glitches when scrolling in popoversYevgeny Makarov
2020-02-01UI: Ellipsis Character for Line ContinuationHarley Acheson
Using ellipsis character for line continuation since that glpyh is now narrower. Differential Revision: https://developer.blender.org/D6728 Reviewed by Brecht Van Lommel