Commit Graph

301 Commits

Author SHA1 Message Date
omar
b138f8cbcd Internal: Nav rename preparing for nav inputs ownership changes. IsNavInputPressed() -> IsNavInputTest() 2019-11-13 21:02:25 +01:00
omar
57dc34f4e8 TreeNode: Added IsItemToggledOpen() to explicitly query if item was just open/closed, facilitating interactions with custom multi-selections patterns. (#1896, #1861) 2019-11-08 15:30:15 +01:00
omar
011d475532 TreeNode: The collapsing arrow accepts click even if modifier keys are being held, facilitating interactions with multi-select patterns. (#2886, #1896, #1861) 2019-11-08 15:30:15 +01:00
omar
037126ee0e TreeNode: Reworded code for ImGuiTreeNodeFlags_OpenOnArrow (follow up to f79b2d6c) to make it lightweight. Should be a no-op from user's point of view. Will facilitate using the arrow hovering information in the hot path. (#2886) 2019-11-08 15:00:28 +01:00
omar
8fee5a4349 Internals: Renaming for consistency. 2019-10-31 11:15:40 +01:00
stfx
6bf5aed325 Declaration and assignment can be joined, Member function may be 'const'. (#2875) 2019-10-29 17:11:49 +01:00
Rokas Kupstys
c863c1f6a1 Clean up number rounding. Now it is more obvious what code is doing. (#2862)
Add IM_ROUND() macro
Replace IM_FLOOR(n + 0.5f) and ImFloor(n + 0.5f) with IM_ROUND(n)
2019-10-29 17:05:25 +01:00
omar
9b323a7ebf SplitterBehavior: not using FrameRounding in render (was in first commit of the function, not sure why). (#319) 2019-10-25 11:05:14 +02:00
omar
ec0e953cca Fixed a couple of subtle bounding box vertical positioning issues relating to text baseline alignment.
The issue would generally manifest when laying out multiple items on a same line, with varying heights and text baseline offsets. (#2833)
Some specific examples, e.g. a button with regular frame padding followed by another item with a multi-line label and no frame padding, such as: multi-line text, small button, tree node item, etc. The second item was correctly offset to match text baseline, and would interact/display correctly,but it wouldn't push the contents area boundary low enough.
Note: previously the second parameter to ItemSize() was 0.0f was default, now -1.0f to signify "no text baseline offset request". If you have code using ItemSize() with an hardcoded zero you may need to change it. (+1 squashed commits)
2019-10-23 18:05:44 +02:00
Alexey
be9f1e8f00 ColorPicker: Fixed SV triangle gradient to block (broken in 1.73). (#2864, #2711). [@lewa-j] 2019-10-23 00:43:40 +02:00
omar
048b73dfaa Various comments + Doc: Examples readme. Moved main menu bar code below menu bar code. 2019-10-21 20:57:07 +02:00
Rokas Kupstys
714fe29d1a Replace manual flooring with IM_FLOOR() macro. (#2850)
Macro is used to ensure that flooring operation is always inlined even in debug builds. __forceinline does not force inlining in /Od builds with MSVC.

(cherry picked from commit bc165df6fd7969605bbc07b8a6d3d28f9109e8f3)
2019-10-18 16:18:38 +02:00
omar
a41f0b2df4 Inputs: Fixed a miscalculation in the keyboard/mouse "typematic" repeat delay/rate calculation, used by keys and e.g. repeating mouse buttons as well as the GetKeyPressedAmount() function.
IMPORTANT: Renamed internal CalcTypematicPressedRepeatAmount to CalcTypematicRepeatAmount and reordered the t1, t0 arguments to t0, t1 !!
If you were using a non-default value for io.KeyRepeatRate (previous default was 0.250), you can add +io.KeyRepeatDelay to it to compensate for the fix.  The function was triggering on: 0.0 and (delay+rate*N) where (N>=1). Fixed formula responds to (N>=0).
Effectively it made io.KeyRepeatRate behave like it was set to (io.KeyRepeatRate + io.KeyRepeatDelay).
Fixed the code and altered default io.KeyRepeatRate,Delay from 0.250,0.050 to 0.300,0.050 to compensate.
If you never altered io.KeyRepeatRate nor used GetKeyPressedAmount() this won't affect you.
2019-10-14 23:07:06 +02:00
omar
c7bdec7e18 InputText, Nav: Fixed Left!Right keys broken when activating Keyboard Navigation. (#787) Amend 892dfb1 2019-10-14 22:43:04 +02:00
omar
aeb6481499 InputText: Filter out Ascii 127 (DEL) emitted by low-level OSX layer, as we are using the Key value. (#2578) 2019-10-12 14:27:37 +02:00
omar
bf746c4215 DragScalar, SliderScalar, InputScalar: Added p_ prefix to parameter that are pointers to the datato clarify how they are used, and more comments redirecting to the demo code. (#2844) 2019-10-11 12:04:28 +02:00
omar
927472f5ff Combo: Added _NoMove flag to prevent window from docking, which has an effect in Docking branch (in Master was not noticeable as the Combo code kept repositioning the window). (#2835) 2019-10-07 19:14:08 +02:00
omar
73fa6509a5 Internal: InputTextEx: tweaked a bit of code (should be a no-op) 2019-10-05 16:57:12 +02:00
omar
ee3373d067 TreeNode: Fixed combination of ImGuiTreeNodeFlags_SpanFullWidth and ImGuiTreeNodeFlags_OpenOnArrow incorrectly locating the arrow hit position to the left of the frame. (#2451, #2438, #1897) 2019-10-04 19:21:29 +02:00
domgho
ccb2a947a2 Internal: SliderBehaviorT: Condition '!is_decimal' is always true (#2828) 2019-10-04 11:57:20 +02:00
omar
a6c3be4bda Internals: Tweaks to ItemSize() should be harmless. Added DebugDrawItemRect() helper. 2019-10-03 18:30:41 +02:00
omar
892dfb1dea InputText, Nav: Fixed Home/End key broken when activating Keyboard Navigation. (#787)
Small refactor of ActiveIdUsingXXX inputs flags toward a little more consistent system. (#2637)
2019-10-02 15:57:36 +02:00
omar
c262276988 Version 1.74 WIP 2019-09-30 14:27:56 +02:00
omar
d5efe16157 Version 1.73 2019-09-24 17:02:26 +02:00
goran-w
e100523917 CollapsingHeader: Added support for ImGuiTreeNodeFlags_Bullet and ImGuiTreeNodeFlags_Leaf on framed nodes. (#2159, #2160)
The Bullet and Leaf ImGuiTreeNodeFlags are now taken into account for Framed/CollapsingHeader tree nodes as well. TreeNodeEx() can be used to specify these flags. A choice was made to left-adjust the Framed text when no Bullet/Arrow is rendered, since this was deemed to look better in the Framed context (especially when considering that CollapsingHeader is drawn using NoTreePushOnOpen, so child/sibling Text items etc will often be non-indented).
2019-09-24 12:48:49 +02:00
omar
25849234f6 Internal: Tree: tweaks (initially tried to implement auto-scrolling, stashed) 2019-09-23 13:11:38 +02:00
omar
80b3ab7d3e TabBar: Fixed single tab shrinking reducing the tab to 0.0f size. Broken by a856c670c1. 2019-09-22 22:16:05 +02:00
omar
38d22bc47d ColorPicker / ColorEdit: restore Hue when zeroing Saturation. (#2722, #2770) - changelog, fixed uninitialized variables, tweaks, renaming. 2019-09-20 15:31:39 +02:00
Rokas Kupstys
accb0261b8 ColorPicker / ColorEdit: restore Hue when zeroing Saturation. (#2722, #2770)
Issue is fixed by storing last active color picker color and last hue value when active color picker takes rgb as input. Then if current color picker color matches last active color - hue value will be restored. IDs are not used because ColorEdit4() and ColorWidget4() may call each other in hard-to-predict ways and they both push their own IDs on to the stack. We need hue restoration to happen in entire stack of these widgets if topmost widget used hue restoration. Since these widgets operate on exact same color value - color was chosen as a factor deciding which widgets should restore hue.
2019-09-20 15:31:15 +02:00
omar
9d02ed51e3 TreeNode: Added ImGuiTreeNodeFlags_SpanAvailWidth and ImGuiTreeNodeFlags_SpanFullWidth flags (#2451, #2438, #1897)
Added demo bits.
2019-09-18 17:13:41 +02:00
omar
3f986e72d9 Internal: Offset STB_TEXTURE_K_ defines to remove that change from #2541 + sponsors update. 2019-09-17 12:06:31 +02:00
omar
7d5a17e5e4 Remove trailing spaces (grep for ' \r?$' in visual studio) 2019-09-17 11:33:18 +02:00
omar
404dc0367e BeginTabItem: Fixed case where right-most tab would create an extraneous draw calls (probably related to other tab fitting code in 1.73 wip) 2019-09-17 11:12:33 +02:00
omar
3dcf323c35 Columns: Separator: Fixed a bug where non-visible separators within columns would alter the next row position differently than visible ones.
Fixed rounding issues also leading to change of ScrollMax depending on visible items (in particular negative coordinate would be rounded differently)
2019-09-16 19:15:43 +02:00
Bagrat Dabaghyan
3cf519c9cb Fix DragScalar for unsigned types (#2780)
decreasing the value was broken on arm64
2019-09-16 19:01:39 +02:00
omar
0537ac005f ColorEdit: Disable Hue edit when Saturation==0 instead of letting Hue values jump around. 2019-08-30 20:33:35 +02:00
omar
b59ec7b9b7 DragInt, DragFloat, DragScalar: Using (v_min > v_max) allows locking any edit to the value. 2019-08-30 20:30:21 +02:00
omar
3f99890f40 TabBar: feed desired width (sum of unclipped tabs width) into layout system to allow for auto-resize. (#2768)
Before 1.71 tab bars fed the sum of current width which created feedback loops in certain situations. Amend f95c77eeea.
2019-08-29 14:57:34 +02:00
omar
f8d3d8d7f5 TabBar: improved shrinking for large number of tabs to avoid leaving extraneous space on the right side. Individuals tabs are given integer-rounded width and remainder is spread between tabs left-to-right. 2019-08-29 12:21:09 +02:00
omar
c8418015c2 SliderScalar: Improved assert when using U32 or U64 types with a large v_max value. (#2765)
+  misc minor stuff.
2019-08-28 15:19:10 +02:00
omar
a856c670c1 TabBar: fixed single-tab not shrinking their width down.
+ minor typo fixes (#2738)
2019-08-22 11:38:58 +02:00
omar
7abd41bd5f TabBar: fixed ScrollToBar request creating bouncing loop when tab is larger than available space. 2019-08-19 20:38:17 +02:00
omar
9fce278918 ColorPicker: Made rendering aware of global style alpha of the picker can be faded out. (#2711)
Note that some elements won't accurately fade down with the same intensity, and the color wheel when enabled will have small overlap glitches with (style.Alpha < 1.0).
2019-08-16 11:46:11 +02:00
omar
f624455d7b Version 1.73 WIP 2019-08-01 10:57:13 -07:00
omar
6a0d0dab5a Version 1.72b (patch for nav) 2019-07-31 14:31:06 -07:00
omar
27079e68c2 Nav: Made hovering non-MenuItem Selectable not re-assign the source item for keyboard navigation. 2019-07-31 14:31:06 -07:00
omar
5ef7445d92 Internal: Avoid using GImGui multiple times in same function. 2019-07-30 16:51:12 -07:00
omar
9183e7c426 Version 1.73 WIP 2019-07-29 15:54:32 -07:00
omar
ecb9b1e2eb Version 1.72 2019-07-27 18:15:07 -07:00
omar
824e8c53b4 Internals: Added IMGUI_DEBUG_INI_SETTINGS. Made IMGUI_DEBUG_LOG redefinable in imconfig.h. Comments. Fix to allow Metrics's NodeWindow() being called with a NULL window. 2019-07-23 21:37:09 -07:00