1
0
mirror of synced 2024-12-14 08:42:54 +01:00
ImHex/plugins/builtin/romfs/themes/light.json
SparkyTD 973af4650c
impr: Convert all hex editor popups to floating, movable windows (#1658)
### Problem description
In previous versions of ImHex, all tool windows were implemented as
static popups fixed in the upper left position of the hex view. This PR
refactors all tool popups to use floating windows that can be dragged
around by the user, or closed with a dedicated close button on the title
bar. These popup also support a stylable transparency when the user is
not hovering their mouse over the window.

### Implementation description
I rewrote the logic in `ViewHexEditor::drawPopup()` to use a custom
`ImGuiExt::BeginHoveringPopup` function for rendering the popup windows.
This new function is an almost exact replica of the built-in
`ImGui::BeginPopupModal`, except it does also displays the default
window title bar with a close button.

A second custom function, `ImGuiExt::PopupTitleBarButton` was also added
for rendering small icon-based buttons into the title bar of the parent
popup window. This new function was used to implement an optional
"Pinning" feature that individual popup implementations can specify. If
a window is pinned, it won't close automatically when its main action is
executed. For example, the "Select" button on the Select dialog will
close the popup by default, unless the window is pinned.

### Screenshots
Popup dialogs before:

![image](https://github.com/WerWolv/ImHex/assets/45818400/7c253181-8284-4076-a066-089403554f0f)

Popup dialogs after:


https://github.com/WerWolv/ImHex/assets/45818400/99d1a628-8ac1-40ac-9146-9062091bb0db



### Additional things
- When the user stops hovering their mouse over a popup window, it
becomes semi-transparent, making it easier to see the content behind it
- This PR also introduces the `styles.imhex.popup-alpha` style, making
the transparency effect configurable, including the ability to disable
the effect completely by setting `popup-alpha` to `1.0`.
- Fixed a bug that caused some popup windows to ignore the Enter and the
KeypadEnter keys. With this PR, all tool windows will execute their main
action when the user presses either one of the two Enter keys, and will
also close automatically unless the window is pinned.

### Possible changes and improvements
- Should the transparency effect be disabled if a window is pinned?
- Should the transparency factor be modifiable on the Settings/Interface
page?
- A keyboard shortcut could be added for quickly pinning / unpinning the
current window.
- Can the pin icon stay on the left, or should it be moved next to the
close button, with a similar circular background?

---------

Co-authored-by: WerWolv <werwolv98@gmail.com>
2024-05-10 21:21:19 +02:00

340 lines
11 KiB
JSON

{
"base": "Light",
"colors": {
"imgui": {
"border": "#0000004C",
"border-shadow": "#00000000",
"button": "#4296F966",
"button-active": "#0F87F9FF",
"button-hovered": "#4296F9FF",
"check-mark": "#4296F9FF",
"child-background": "#00000000",
"docking-empty-background": "#EFEFEFFF",
"docking-preview": "#4296F937",
"drag-drop-target": "#4296F9F2",
"frame-background": "#FFFFFFFF",
"frame-background-active": "#4296F9AA",
"frame-background-hovered": "#4296F966",
"header": "#4296F94F",
"header-active": "#4296F9FF",
"header-hovered": "#4296F9CC",
"menu-bar-background": "#DBDBDBFF",
"modal-window-dim-background": "#33333359",
"nav-highlight": "#4296F9CC",
"nav-windowing-background": "#33333333",
"nav-windowing-highlight": "#B2B2B2B2",
"plot-histogram": "#E5B200FF",
"plot-histogram-hovered": "#FF7200FF",
"plot-lines": "#636363FF",
"plot-lines-hovered": "#FF6D59FF",
"popup-background": "#FFFFFFFF",
"resize-grip": "#5959592B",
"resize-grip-active": "#4296F9F2",
"resize-grip-hovered": "#4296F9AA",
"scrollbar-background": "#F9F9F987",
"scrollbar-grab": "#AFAFAFCC",
"scrollbar-grab-active": "#7C7C7CFF",
"scrollbar-grab-hovered": "#7C7C7CCC",
"separator": "#6363639E",
"separator-active": "#2370CCFF",
"separator-hovered": "#2370CCC6",
"slider-grab": "#4296F9C6",
"slider-grab-active": "#7589CC99",
"tab": "#C2CBD5ED",
"tab-active": "#97B9E1FF",
"tab-hovered": "#4296F9CC",
"tab-unfocused": "#EAECEEFB",
"tab-unfocused-active": "#BDD1E9FF",
"table-border-light": "#ADADBCFF",
"table-border-strong": "#9191A3FF",
"table-header-background": "#C6DDF9FF",
"table-row-background": "#00000000",
"table-row-background-alt": "#4C4C4C16",
"text": "#000000FF",
"text-disabled": "#999999FF",
"text-selected-background": "#4296F959",
"title-background": "#DBDBDBFF",
"title-background-active": "#DBDBDBFF",
"title-background-collapse": "#DBDBDBFF",
"window-background": "#EFEFEFFF",
"window-shadow": "#00000055"
},
"imhex": {
"blur-background": "#00000000",
"desc-button": "#E6E6E6FF",
"desc-button-active": "#BEBEBEFF",
"desc-button-hovered": "#D2D2D2FF",
"highlight": "#299770FF",
"IEEE-tool-sign": "#BBBBFFFF",
"IEEE-tool-exp": "#BBFFBBFF",
"IEEE-tool-mantissa": "#FFBBBBFF",
"toolbar-blue": "#06539BFF",
"toolbar-brown": "#DBB377FF",
"toolbar-gray": "#191919FF",
"toolbar-green": "#388B42FF",
"toolbar-purple": "#672A78FF",
"toolbar-red": "#E74C3CFF",
"toolbar-yellow": "#F1C40FFF",
"logger-debug": "#388B42FF",
"logger-info": "#06539BFF",
"logger-warning": "#F1C40FFF",
"logger-error": "#E74C3CFF",
"logger-fatal": "#672A78FF",
"achievement-unlocked": "#F1C40FFF",
"find-highlight": "#672A78FF",
"diff-added": "#388B42FF",
"diff-removed": "#E74C3CFF",
"diff-changed": "#F1C40FFF",
"advanced-encoding-ascii": "#06539BFF",
"advanced-encoding-single": "#E74C3CFF",
"advanced-encoding-multi": "#F1C40FFF",
"advanced-encoding-unknown": "#E74C3CFF",
"patches": "#E74C3CFF",
"pattern-selected": "#06539BFF"
},
"imnodes": {
"box-selector": "#5AAAFA1E",
"box-selector-outline": "#5AAAFA96",
"grid-background": "#E1E1E1FF",
"grid-line": "#B4B4B464",
"grid-line-primary": "#78787864",
"link": "#4296FA64",
"link-hovered": "#4296FAF2",
"link-selected": "#4296FAF2",
"mini-map-background": "#19191964",
"mini-map-background-hovered": "#191919C8",
"mini-map-canvas": "#C8C8C819",
"mini-map-canvas-outline": "#C8C8C8C8",
"mini-map-link": "#4296FA64",
"mini-map-link-selected": "#4296FAF2",
"mini-map-node-background": "#C8C8C864",
"mini-map-node-background-hovered": "#C8C8C8FF",
"mini-map-node-background-selected": "#C8C8F0FF",
"mini-map-node-outline": "#C8C8C864",
"mini-map-outline": "#96969664",
"mini-map-outline-hovered": "#969696C8",
"node-background": "#F0F0F0FF",
"node-background-hovered": "#F0F0F0FF",
"node-background-selected": "#F0F0F0FF",
"node-outline": "#646464FF",
"pin": "#4F8CE0FF",
"pin-hovered": "#13529CFF",
"title-bar": "#F8F8F8FF",
"title-bar-hovered": "#D1D1D1FF",
"title-bar-selected": "#D1D1D1FF"
},
"implot": {
"axis-bg": "auto",
"axis-bg-active": "auto",
"axis-bg-hovered": "auto",
"axis-grid": "#FFFFFFFF",
"axis-text": "auto",
"axis-tick": "#0000003F",
"crosshairs": "#0000007F",
"error-bar": "auto",
"fill": "auto",
"frame-bg": "#FFFFFFFF",
"inlay-text": "#000000FF",
"legend-bg": "#FFFFFFF9",
"legend-border": "#D1D1D1CC",
"legend-text": "#000000FF",
"line": "auto",
"marker-fill": "auto",
"marker-outline": "auto",
"plot-bg": "#6B91FF21",
"plot-border": "#00000000",
"selection": "#D1A307FF",
"title-text": "#000000FF"
},
"text-editor": {
"background": "#FFFFFFFF",
"breakpoint": "#FF200080",
"char-literal": "#704030FF",
"comment": "#205020FF",
"current-line-edge": "#00000040",
"current-line-fill": "#00000040",
"current-line-fill-inactive": "#80808040",
"cursor": "#000000FF",
"default": "#7F7F7FFF",
"error-marker": "#FF1000A0",
"identifier": "#404040FF",
"keyword": "#060CFFFF",
"known-identifier": "#106060FF",
"line-number": "#005050FF",
"multi-line-comment": "#205040FF",
"number": "#008000FF",
"preproc-identifier": "#A040C0FF",
"preprocessor": "#606040FF",
"punctuation": "#000000FF",
"selection": "#00006080",
"string": "#A02020FF"
}
},
"image_theme": "light",
"name": "Light",
"styles": {
"imgui": {
"alpha": 1.0,
"button-text-align": [
0.5,
0.5
],
"cell-padding": [
4.0,
2.0
],
"child-border-size": 1.0,
"child-rounding": 0.0,
"disabled-alpha": 0.6,
"frame-border-size": 0.0,
"frame-padding": [
4.0,
3.0
],
"frame-rounding": 0.0,
"grab-min-size": 12.0,
"grab-rounding": 0.0,
"indent-spacing": 10.0,
"item-inner-spacing": [
4.0,
4.0
],
"item-spacing": [
8.0,
4.0
],
"popup-border-size": 1.0,
"popup-rounding": 0.0,
"scrollbar-rounding": 9.0,
"scrollbar-size": 14.0,
"selectable-text-align": [
0.0,
0.0
],
"tab-rounding": 4.0,
"window-border-size": 1.0,
"window-min-size": [
32.0,
32.0
],
"window-padding": [
8.0,
8.0
],
"window-rounding": 0.0,
"window-title-align": [
0.0,
0.5
],
"window-shadow-size": 64.0,
"window-shadow-offset": 0.0,
"window-shadow-angle": 0.0
},
"imnodes": {
"grid-spacing": 24.0,
"link-hover-distance": 10.0,
"link-line-segments-per-length": 0.1,
"link-thickness": 3.0,
"mini-map-offset": [
4.0,
4.0
],
"mini-map-padding": [
8.0,
8.0
],
"node-border-thickness": 1.0,
"node-corner-rounding": 4.0,
"node-padding": [
8.0,
8.0
],
"pin-circle-radius": 4.0,
"pin-hover-radius": 10.0,
"pin-line-thickness": 1.0,
"pin-offset": 0.0,
"pin-quad-side-length": 7.0,
"pin-triangle-side-length": 9.5
},
"implot": {
"annotation-padding": [
2.0,
2.0
],
"digital-bit-gap": 4.0,
"digital-bit-height": 8.0,
"error-bar-size": 5.0,
"error-bar-weight": 1.5,
"fill-alpha": 1.0,
"fit-padding": [
0.0,
0.0
],
"label-padding": [
5.0,
5.0
],
"legend-inner-padding": [
5.0,
5.0
],
"legend-padding": [
10.0,
10.0
],
"legend-spacing": [
5.0,
0.0
],
"line-weight": 1.0,
"major-grid-size": [
1.0,
1.0
],
"major-tick-len": [
10.0,
10.0
],
"major-tick-size": [
1.0,
1.0
],
"marker-size": 4.0,
"marker-weight": 1.0,
"minor-alpha": 0.25,
"minor-grid-size": [
1.0,
1.0
],
"minor-tick-len": [
5.0,
5.0
],
"minor-tick-size": [
1.0,
1.0
],
"mouse-pos-padding": [
10.0,
10.0
],
"plot-border-size": 1.0,
"plot-default-size": [
400.0,
300.0
],
"plot-min-size": [
200.0,
150.0
],
"plot-padding": [
10.0,
10.0
]
},
"imhex": {
"window-blur": 0.0,
"popup-alpha": 0.65
}
}
}