omar
575df6f192
Merge branch 'master' into docking
...
# Conflicts:
# examples/imgui_impl_opengl3.cpp
# imgui.cpp
# imgui_draw.cpp
# imgui_internal.h
2019-09-17 16:35:50 +02:00
omar
3b014d0c31
Merge branch 'features/ellipsis_rendering'
...
# Conflicts:
# imgui.cpp
2019-09-17 12:07:30 +02:00
omar
7d5a17e5e4
Remove trailing spaces (grep for ' \r?$' in visual studio)
2019-09-17 11:33:18 +02:00
Rokas Kupstys
45405f0dc9
Font: implement a way to draw narrow ellipsis without relying on hardcoded 1 pixel dots. ( #2775 )
...
This changeset implements several pieces of the puzzle that add up to a narrow ellipsis rendering.
## EllipsisCodePoint
`ImFontConfig` and `ImFont` received `ImWchar EllipsisCodePoint = -1;` field. User may configure `ImFontConfig::EllipsisCodePoint` a unicode codepoint that will be used for rendering narrow ellipsis. Not setting this field will automatically detect a suitable character or fall back to rendering 3 dots with minimal spacing between them. Autodetection prefers codepoint 0x2026 (narrow ellipsis) and falls back to 0x0085 (NEXT LINE) when missing. Wikipedia indicates that codepoint 0x0085 was used as ellipsis in some older windows fonts. So does default Dear ImGui font. When user is merging fonts - first configured and present ellipsis codepoint will be used, ellipsis characters from subsequently merged fonts will be ignored.
## Narrow ellipsis
Rendering a narrow ellipsis is surprisingly not straightforward task. There are cases when ellipsis is bigger than the last visible character therefore `RenderTextEllipsis()` has to hide last two characters. In a subset of those cases ellipsis is as big as last visible character + space before it. `RenderTextEllipsis()` tries to work around this case by taking free space between glyph edges into account. Code responsible for this functionality is within `if (text_end_ellipsis != text_end_full) { ... }`.
## Fallback (manually rendered dots)
There are cases when font does not have ellipsis character defined. In this case RenderTextEllipsis() falls back to rendering ellipsis as 3 dots, but with reduced spacing between them. 1 pixel space is used in all cases. This results in a somewhat wider ellipsis, but avoids issues where spaces between dots are uneven (visible in larger/monospace fonts) or squish dots way too much (visible in default font where dot is essentially a pixel). This fallback method obsoleted `RenderPixelEllipsis()` and this function was removed. Note that fallback ellipsis will always be somewhat wider than it could be, however it will fit in visually into every font used unlike what `RenderPixelEllipsis()` produced.
2019-09-17 11:13:07 +02:00
omar
b05f6f6f50
Nav, Scrolling: Added support for Home/End key. ( #787 )
2019-09-16 19:01:40 +02:00
omar
c077dd4872
Fixed missing IMGUI_API for IsMouseDragPastThreshold().
2019-08-31 19:59:51 +02:00
omar
0bdc145343
Merge branch 'master' into docking
...
# Conflicts:
# imgui.cpp
# imgui_internal.h
2019-08-31 19:19:00 +02:00
omar
d049a7988c
Docking: comments for DockBuilder API.
2019-08-31 16:51:12 +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
9e294be5c5
Docking: Fix for node created at the same time as windows that are still resizing (typically with io.ConfigDockingAlwaysTabBar) to not be zero/min sized. ( #2109 )
...
The fix delay their visibility by one frame, which is not ideal but not very problematic as the .ini data gets populated after that
2019-08-29 10:45:33 +02:00
omar
62f75c7fb1
Added a mechanism to compact/free the larger allocations of unused windows (buffers are compacted when a window is unused for 60 seconds, as per io.ConfigWindowsMemoryCompactTimer = 60.0f). Note that memory usage has never been reported as a problem, so this is merely a touch of overzealous luxury. ( #2636 )
2019-08-28 20:28:36 +02:00
omar
483534b525
Internals: Using simpler ImVec2ih construct + fixed misnamed member.
2019-08-23 12:31:14 +02:00
omar
e1fca8d982
Merge branch 'master' into docking
...
# Conflicts:
# imgui.cpp
# imgui_internal.h
2019-08-23 12:21:49 +02:00
omar
cb538fadfe
Internals: Storing settings using ImVec2ih to match what we are doing with dock node. + removed ImMax from reading Size value (done in Begin) + removed seemingly unnecessary FLT_MAX compare in SettingsHandlerWindow_WriteAll.
...
About: Added backquote to text copied into clipboard so it doesn't mess up with github formatting when pasted.
2019-08-23 12:02:52 +02:00
omar
27431dcc6b
Docking: fix BeginDocked() path that creates node so that SetNextWindowDockID() doesn't immediately discard the node..( #2109 )
...
Amend 515ecbddc2
, not sure at this point if the (auto_dock_node) flag was needed at all.
Comments. Exposed DockContextGenNodeID() in imgui_internal.h
2019-08-22 13:51:16 +02:00
omar
72090b646f
Fixed incorrect assignment of IsFallbackWindow which would tag dock node host windows created in NewFrame() as such, messing with popup viewport inheritance.
2019-08-22 11:35:17 +02:00
omar
aedcd2fb1a
Merge branch 'master' into docking
...
# Conflicts:
# docs/CHANGELOG.txt
# examples/imgui_impl_dx11.cpp
# imgui.cpp
2019-08-19 21:49:53 +02:00
omar
5d87ee8d82
Internals: Added function index for Viewport and Docking. Renamed a few functions.
2019-08-16 15:29:58 +02:00
omar
f624455d7b
Version 1.73 WIP
2019-08-01 10:57:13 -07:00
omar
967073ba3d
Viewport: Handle case where host window gets moved and resized simultaneous (toggling maximized state). There's no perfect solution there, than using io.ConfigViewportsNoAutoMerge = false. ( #1542 )
2019-07-31 20:08:06 -07:00
omar
9bd7846f07
Internal: Made ScrollToBringRectIntoView() handle recursing back to scroll parent window, so the function can be called elsewhere (instead of 1 deep recursion done in NavUpdateMoveResult().
2019-07-31 18:37:55 -07:00
omar
b8d8355f10
Merge branch 'master' into docking
...
# Conflicts:
# docs/CHANGELOG.txt
# imgui.cpp
2019-07-31 14:34:58 -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
4cfaf7d89c
Scrolling, Nav: Fixed programmatic scroll leading to a slightly incorrect scroll offset when the window has decorations or a menu-bar (broken in 1.71). This was mostly noticeable when a keyboard/gamepad movement led to scrolling the view, or using e.g. SetScrollHereY() function. Fix/amend a0994d74
.
2019-07-31 14:31:06 -07:00
omar
3548fb8013
Internal refactor: moved all Scroll related functions in a same spot.
2019-07-30 20:04:02 -07:00
omar
1b1e539288
Internal: Moved NavScrollToBringItemIntoView() declaration to imgui_internal.h. Fixed spacing missing in 494d804
. Fixed changelog wreck from 1.72.
2019-07-30 18:21:44 -07:00
omar
494d804735
Internal: Added ImGuiInputTextState::ClearText() helper.
2019-07-30 15:02:40 -07:00
omar
cb2de62bb1
Docking: Renaming, comments.
2019-07-29 15:56:59 -07:00
omar
9183e7c426
Version 1.73 WIP
2019-07-29 15:54:32 -07:00
omar
a1164399b0
Merge branch 'master' into docking
...
# Conflicts:
# docs/CHANGELOG.txt
2019-07-27 18:21:41 -07:00
omar
ecb9b1e2eb
Version 1.72
2019-07-27 18:15:07 -07:00
omar
7a26a49f08
Internal: Added IsMouseDragPastThreshold(). Tweaks. Todo.
...
Demo: Showing how to use the format parameter of Slider/Drag functions to display the name of an enum value instead of the underlying integer value
2019-07-26 17:19:01 -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
omar
969278fc0b
Docking: Fixed dragging/resizing from OS decoration not marking settings as dirty.
...
Internals: Added IMGUI_DEBUG_LOG_DOCKING, IMGUI_DEBUG_LOG_VIEWPORT macros to easily enable/disable a bunch of logging code.
2019-07-23 21:29:43 -07:00
omar
efc4c0fe9d
Internals: 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:26:15 -07:00
omar
db2581bee9
Merge branch 'master' into docking
...
# Conflicts:
# imgui.cpp
2019-07-23 13:35:01 -07:00
omar
baae057a03
Internals: Merge in minor noise from wip Tables branch to simplify further merging.
2019-07-23 13:28:36 -07:00
omar
26f14e056c
Scrolling: Made mouse-wheel scrolling lock the underlying window until the mouse is moved again or until a short delay expires (2 seconds). This allow uninterrupted scroll even if child windows are passing under the mouse cursor. ( #2604 )
2019-07-22 18:49:52 -07:00
omar
dcd03f62a7
Scrolling: Made it possible for mouse wheel and navigation-triggered scrolling to override a call to SetScrollX()/SetScrollY(), making it possible to use a simpler stateless pattern for auto-scrolling.
...
Demo: Log, Console: Using a simpler stateless pattern for auto-scrolling.
2019-07-22 18:49:51 -07:00
omar
75136d3bea
Internals: Removed ShowDockingDemo(), moved into Metrics. Metrics: Added more links to browse window->node, node->window, node->node etc.
2019-07-22 11:51:04 -07:00
omar
0e6a096afd
Docking: Renamed io.ConfigDockingTabBarOnSingleWindows to io.ConfigDockingAlwaysTabBar. ( #2109 )
...
Added ImGuiWindowClass::DockingAlwaysTabBar to set on individual windows.
2019-07-22 11:29:22 -07:00
omar
6f8d34768d
Docking: Removed seemingly unnecessary test in TabItemEx() for undocking tab leading to window move. Added ImGuiDockNode::IsFloatingNode() helper to clarify code intent in various places.
2019-07-22 11:02:44 -07:00
omar
9f35ba8546
Merge branch 'master' into docking
...
# Conflicts:
# imgui.cpp
2019-07-19 15:19:10 -07:00
ocornut
047dc16af5
Debug Tools: Added DebugStartItemPicker() in imgui_internal.h to facilitate binding this anywhere in user's tool. Adedd highlight. Added IMGUI_DEBUG_TOOL_ITEM_PICKER_EX to break in ItemAdd().
2019-07-19 11:28:03 -07:00
omar
7fd34d4f30
Merge branch 'master' into docking
...
# Conflicts:
# imgui.cpp
# imgui_internal.h
2019-07-17 18:48:16 -07:00
omar
1f3feb481e
Internals: Refactor: Moved all Columns code from imgui.cpp to imgui_widgets.cpp ( #125 )
...
Also moved NextColumn between BeginColumn and NextColumn which makes it easier to work on that code.
2019-07-17 17:10:27 -07:00
omar
bb2aa5e770
Docking: Making it possible to undock a node by clicking on the tab bar / title bar for the node. ( #2645 , #2109 )
2019-07-17 13:55:00 -07:00
omar
ea79992d9a
Fixed old SetWindowFontScale() api value from not being inherited by child window. Added comments about the right way to scale your UI (load a font at the right side, rebuild atlas, scale style).
...
+ Added missing IMGUI_API marker to the EmptyString storage used by ImGuiTextBuffer. (#2672 )
2019-07-17 10:01:49 -07:00
omar
56e10f1c35
Merge branch 'master' into docking
...
# Conflicts:
# imgui.cpp
# imgui.h
2019-07-16 18:29:31 -07:00