This commit is contained in:
@@ -49,6 +49,9 @@ Other Changes:
|
|||||||
for user code to bypass it without using a clickable item. (#9382)
|
for user code to bypass it without using a clickable item. (#9382)
|
||||||
- Clicking on a window's empty-space to move/focus a window checks
|
- Clicking on a window's empty-space to move/focus a window checks
|
||||||
for lack of queued focus request. (#9382)
|
for lack of queued focus request. (#9382)
|
||||||
|
- InputText:
|
||||||
|
- Added style.InputTextCursorSize to configure cursor/caret thickness. (#7031, #9409)
|
||||||
|
This is automatically scaled by style.ScaleAllSizes().
|
||||||
- Demo:
|
- Demo:
|
||||||
- Extract 'Widgets->Tree Nodes->Selectable Nodes' out of the 'Advanced'
|
- Extract 'Widgets->Tree Nodes->Selectable Nodes' out of the 'Advanced'
|
||||||
demo for clarity (manual reimplementation of basic selection).
|
demo for clarity (manual reimplementation of basic selection).
|
||||||
|
|||||||
@@ -1537,6 +1537,7 @@ ImGuiStyle::ImGuiStyle()
|
|||||||
ColorButtonPosition = ImGuiDir_Right; // Side of the color button in the ColorEdit4 widget (left/right). Defaults to ImGuiDir_Right.
|
ColorButtonPosition = ImGuiDir_Right; // Side of the color button in the ColorEdit4 widget (left/right). Defaults to ImGuiDir_Right.
|
||||||
ButtonTextAlign = ImVec2(0.5f,0.5f);// Alignment of button text when button is larger than text.
|
ButtonTextAlign = ImVec2(0.5f,0.5f);// Alignment of button text when button is larger than text.
|
||||||
SelectableTextAlign = ImVec2(0.0f,0.0f);// Alignment of selectable text. Defaults to (0.0f, 0.0f) (top-left aligned). It's generally important to keep this left-aligned if you want to lay multiple items on a same line.
|
SelectableTextAlign = ImVec2(0.0f,0.0f);// Alignment of selectable text. Defaults to (0.0f, 0.0f) (top-left aligned). It's generally important to keep this left-aligned if you want to lay multiple items on a same line.
|
||||||
|
InputTextCursorSize = 1.0f; // Thickness of cursor/caret in InputText().
|
||||||
SeparatorSize = 1.0f; // Thickness of border in Separator().
|
SeparatorSize = 1.0f; // Thickness of border in Separator().
|
||||||
SeparatorTextBorderSize = 3.0f; // Thickness of border in SeparatorText().
|
SeparatorTextBorderSize = 3.0f; // Thickness of border in SeparatorText().
|
||||||
SeparatorTextAlign = ImVec2(0.0f,0.5f);// Alignment of text within the separator. Defaults to (0.0f, 0.5f) (left aligned, center).
|
SeparatorTextAlign = ImVec2(0.0f,0.5f);// Alignment of text within the separator. Defaults to (0.0f, 0.5f) (left aligned, center).
|
||||||
@@ -1612,6 +1613,7 @@ void ImGuiStyle::ScaleAllSizes(float scale_factor)
|
|||||||
DragDropTargetBorderSize = ImTrunc(DragDropTargetBorderSize * scale_factor);
|
DragDropTargetBorderSize = ImTrunc(DragDropTargetBorderSize * scale_factor);
|
||||||
DragDropTargetPadding = ImTrunc(DragDropTargetPadding * scale_factor);
|
DragDropTargetPadding = ImTrunc(DragDropTargetPadding * scale_factor);
|
||||||
ColorMarkerSize = ImTrunc(ColorMarkerSize * scale_factor);
|
ColorMarkerSize = ImTrunc(ColorMarkerSize * scale_factor);
|
||||||
|
InputTextCursorSize = ImTrunc(InputTextCursorSize * scale_factor);
|
||||||
SeparatorSize = ImTrunc(SeparatorSize * scale_factor);
|
SeparatorSize = ImTrunc(SeparatorSize * scale_factor);
|
||||||
SeparatorTextBorderSize = ImTrunc(SeparatorTextBorderSize * scale_factor);
|
SeparatorTextBorderSize = ImTrunc(SeparatorTextBorderSize * scale_factor);
|
||||||
SeparatorTextPadding = ImTrunc(SeparatorTextPadding * scale_factor);
|
SeparatorTextPadding = ImTrunc(SeparatorTextPadding * scale_factor);
|
||||||
|
|||||||
@@ -2339,6 +2339,7 @@ struct ImGuiStyle
|
|||||||
ImGuiDir ColorButtonPosition; // Side of the color button in the ColorEdit4 widget (left/right). Defaults to ImGuiDir_Right.
|
ImGuiDir ColorButtonPosition; // Side of the color button in the ColorEdit4 widget (left/right). Defaults to ImGuiDir_Right.
|
||||||
ImVec2 ButtonTextAlign; // Alignment of button text when button is larger than text. Defaults to (0.5f, 0.5f) (centered).
|
ImVec2 ButtonTextAlign; // Alignment of button text when button is larger than text. Defaults to (0.5f, 0.5f) (centered).
|
||||||
ImVec2 SelectableTextAlign; // Alignment of selectable text. Defaults to (0.0f, 0.0f) (top-left aligned). It's generally important to keep this left-aligned if you want to lay multiple items on a same line.
|
ImVec2 SelectableTextAlign; // Alignment of selectable text. Defaults to (0.0f, 0.0f) (top-left aligned). It's generally important to keep this left-aligned if you want to lay multiple items on a same line.
|
||||||
|
float InputTextCursorSize; // Thickness of cursor/caret in InputText().
|
||||||
float SeparatorSize; // Thickness of border in Separator(). Must be >= 1.0f.
|
float SeparatorSize; // Thickness of border in Separator(). Must be >= 1.0f.
|
||||||
float SeparatorTextBorderSize; // Thickness of border in SeparatorText()
|
float SeparatorTextBorderSize; // Thickness of border in SeparatorText()
|
||||||
ImVec2 SeparatorTextAlign; // Alignment of text within the separator. Defaults to (0.0f, 0.5f) (left aligned, center).
|
ImVec2 SeparatorTextAlign; // Alignment of text within the separator. Defaults to (0.0f, 0.5f) (left aligned, center).
|
||||||
|
|||||||
+1
-1
@@ -5643,7 +5643,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
|
|||||||
ImVec2 cursor_screen_pos = ImTrunc(draw_pos + cursor_offset - draw_scroll);
|
ImVec2 cursor_screen_pos = ImTrunc(draw_pos + cursor_offset - draw_scroll);
|
||||||
ImRect cursor_screen_rect(cursor_screen_pos.x, cursor_screen_pos.y - g.FontSize + 0.5f, cursor_screen_pos.x + 1.0f, cursor_screen_pos.y - 1.5f);
|
ImRect cursor_screen_rect(cursor_screen_pos.x, cursor_screen_pos.y - g.FontSize + 0.5f, cursor_screen_pos.x + 1.0f, cursor_screen_pos.y - 1.5f);
|
||||||
if (cursor_is_visible && cursor_screen_rect.Overlaps(clip_rect))
|
if (cursor_is_visible && cursor_screen_rect.Overlaps(clip_rect))
|
||||||
draw_window->DrawList->AddLineV(cursor_screen_rect.Min.x, cursor_screen_rect.Min.y, cursor_screen_rect.Max.y, GetColorU32(ImGuiCol_InputTextCursor), 1.0f * (float)(int)style._MainScale); // FIXME-DPI: Cursor thickness (#7031)
|
draw_window->DrawList->AddLineV(cursor_screen_rect.Min.x, cursor_screen_rect.Min.y, cursor_screen_rect.Max.y, GetColorU32(ImGuiCol_InputTextCursor), style.InputTextCursorSize);
|
||||||
|
|
||||||
// Notify OS of text input position for advanced IME (-1 x offset so that Windows IME can cover our cursor. Bit of an extra nicety.)
|
// Notify OS of text input position for advanced IME (-1 x offset so that Windows IME can cover our cursor. Bit of an extra nicety.)
|
||||||
// This is required for some backends (SDL3) to start emitting character/text inputs.
|
// This is required for some backends (SDL3) to start emitting character/text inputs.
|
||||||
|
|||||||
Reference in New Issue
Block a user