18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-14 09:06:58 +01:00
Commit Graph

10 Commits

Author SHA1 Message Date
maj00r
d0ca44cd67 fix(ui): a popup begun outside any window stays in the main window too
A popup begun outside any window, as the context menus of the editor, the dialogs for a new scenery and for opening one and the
pause dialog of the driver are, takes no viewport from a parent. It was put into the main window only where it merged there:
with the main window minimized, or behind a panel taken out into a window of its own, it got a window of the system of its own,
with an OpenGL context of its own, the way the editor froze. With io.ConfigViewportsNoAutoDetach the tooltips and popups stay in
the main window there too.

The comment of io.ConfigViewportsNoAutoDetach tells how they're placed: as with the viewports off, not shrunk.
io.ConfigTooltipsWrapWidth moves to the miscellaneous options, it works with the viewports off as well, and its comment tells
that SetItemTooltip() wraps too and BeginTooltip() doesn't.
2026-11-08 19:58:48 +01:00
maj00r
be40008808 fix(ui): tooltips and popups stay in the main window, and a long tooltip wraps
With the panels in separate windows on (the default), a tooltip or a popup that didn't fit in the main window got a window of
the system of its own, with an OpenGL context of its own. The editor froze so on 2026-11-08: its main thread stuck for good in
the NVIDIA driver while making the context of an invisible window 1925 x 29 px, a tooltip in one line wider than the screen.
The Polish texts of the editor have tooltips of up to 360 characters in a line; the one of the curve mode of laying track is
2088 px wide.

- io.ConfigViewportsNoAutoDetach (a MaSzyna addition, set with the separate windows) keeps the tooltips and popups shown over
  the main window inside it too, placed and shrunk as they are without the separate windows: they get no viewport of their
  own. A panel dragged out of the main window by hand still gets its window, and the tooltips and popups over it may go past
  its edge as before.
- io.ConfigTooltipsWrapWidth (a MaSzyna addition): SetTooltip() wraps its text at this width. The ui sets 40 em, 520 px at the
  font of 13 px.

Checked in the editor on a hidden desktop: the tooltip of the curve mode, full screen 1920 x 1080, and the one of the redo
button at the edge of a window 1280 x 720 each made a window of their own before, and none now. Both are drawn in the main
window, the long one in five lines.
2026-11-08 19:26:19 +01:00
maj00r
5fa03304ef fix(ui): keep panels in the main window when resizing them at the screen edge
Pulling a panel's grip into the corner of the screen pushed it a couple of
pixels past the main window, and ImGui gave it an OS window of its own. Now
a panel only comes out when dragged with the cursor outside the main window.

A panel that stays in the main window needs its grips in reach, so a resize
stops at the edge, and a panel left past the edge or too big for the window
is moved back and shrunk to fit.

This is a new io.ConfigViewportsNoAutoDetach option in our copy of ImGui, so
it has to be carried over when ImGui gets updated. ImGui itself has no option
for this, as of 1.93.1.
2026-10-31 01:47:40 +01:00
344034ec70 feat(ui): imgui 1.91.9b-docking in place of 1.73: local changes of the backends carried over (glad as the gl loader, srgb and gamma of the ui, gles glsl string), BufferingBar/Spinner kept, imgui_tables in cmake; cursor position, cursor enter and focus of the main window passed to the glfw backend, which works with events now; code adapted to the api: ImGuiListClipper::Begin, BeginListBox, ImTextureID as an integer, ImageButton with an id, ImGuiKey without GetKeyIndex, logarithmic sliders in place of the removed power argument; ImGuizmo with the math operators defined before imgui.h and SetNextFrameWantCaptureMouse 2026-10-08 20:38:13 +02:00
milek7
29f8f91ad8 Merge remote-tracking branch 'tmj/master' into sim 2020-10-18 23:35:14 +02:00
milek7
5c84f8b156 remove DBG_NEW new preprocessor kludges, ensure stdafx.h is included everywhere, add debug build to Azure CI 2019-08-30 23:35:58 +02:00
milek7
684ff24087 update imgui 2019-07-01 00:09:04 +02:00
milek7
89cf20a251 map improvements 2019-02-18 17:46:31 +01:00
milek7
b0dc3e5269 imgui update, fix gl2 imgui 2018-10-12 17:33:34 +02:00
milek7
d9687a4e1f Merge branch 'tmj-dev' into milek-dev 2018-09-16 22:48:53 +02:00