TextField: added styles for buttons and toolbars in leading and trailing components (smaller margins/insets, better hover/pressed/selected colors)

This commit is contained in:
Karl Tauber
2021-12-12 18:43:29 +01:00
parent 51be7ad832
commit 1b3cc223da
10 changed files with 159 additions and 8 deletions

View File

@@ -1419,6 +1419,26 @@ ViewportUI com.formdev.flatlaf.ui.FlatViewportUI
[style].small font: $small.font
#---- [style]Button ----
[style]Button.inTextField focusable: false; toolbar.margin: 1,1,1,1; toolbar.spacingInsets: 1,1,1,1; background: $TextField.background; toolbar.hoverBackground: lighten($TextField.background,4%,derived); toolbar.pressedBackground: lighten($TextField.background,6%,derived); toolbar.selectedBackground: lighten($TextField.background,12%,derived)
#---- [style]ToggleButton ----
[style]ToggleButton.inTextField focusable: false; toolbar.margin: 1,1,1,1; toolbar.spacingInsets: 1,1,1,1; background: $TextField.background; toolbar.hoverBackground: lighten($TextField.background,4%,derived); toolbar.pressedBackground: lighten($TextField.background,6%,derived); toolbar.selectedBackground: lighten($TextField.background,12%,derived)
#---- [style]ToolBar ----
[style]ToolBar.inTextField floatable: false; opaque: false; borderMargins: 0,0,0,0
#---- [style]ToolBarSeparator ----
[style]ToolBarSeparator.inTextField separatorWidth: 3
#---- ----
activeCaption #434e60 HSL 217 18 32 javax.swing.plaf.ColorUIResource [UI]

View File

@@ -1424,6 +1424,26 @@ ViewportUI com.formdev.flatlaf.ui.FlatViewportUI
[style].small font: $small.font
#---- [style]Button ----
[style]Button.inTextField focusable: false; toolbar.margin: 1,1,1,1; toolbar.spacingInsets: 1,1,1,1; background: $TextField.background; toolbar.hoverBackground: darken($TextField.background,4%,derived); toolbar.pressedBackground: darken($TextField.background,8%,derived); toolbar.selectedBackground: darken($TextField.background,12%,derived)
#---- [style]ToggleButton ----
[style]ToggleButton.inTextField focusable: false; toolbar.margin: 1,1,1,1; toolbar.spacingInsets: 1,1,1,1; background: $TextField.background; toolbar.hoverBackground: darken($TextField.background,4%,derived); toolbar.pressedBackground: darken($TextField.background,8%,derived); toolbar.selectedBackground: darken($TextField.background,12%,derived)
#---- [style]ToolBar ----
[style]ToolBar.inTextField floatable: false; opaque: false; borderMargins: 0,0,0,0
#---- [style]ToolBarSeparator ----
[style]ToolBarSeparator.inTextField separatorWidth: 3
#---- ----
activeCaption #99b4d1 HSL 211 38 71 javax.swing.plaf.ColorUIResource [UI]

View File

@@ -1437,6 +1437,26 @@ ViewportUI com.formdev.flatlaf.ui.FlatViewportUI
[style].small font: $small.font
#---- [style]Button ----
[style]Button.inTextField focusable: false; toolbar.margin: 1,1,1,1; toolbar.spacingInsets: 1,1,1,1
#---- [style]ToggleButton ----
[style]ToggleButton.inTextField focusable: false; toolbar.margin: 1,1,1,1; toolbar.spacingInsets: 1,1,1,1
#---- [style]ToolBar ----
[style]ToolBar.inTextField floatable: false; opaque: false; borderMargins: 0,0,0,0
#---- [style]ToolBarSeparator ----
[style]ToolBarSeparator.inTextField separatorWidth: 3
#---- ----
activeCaption #99b4d1 HSL 211 38 71 javax.swing.plaf.ColorUIResource [UI]

View File

@@ -443,3 +443,15 @@ Tree.paintLines = true
Tree.hash = #f00
Tree.editorBorder = 1,1,1,1,#f00
Tree.editorBorderSelectionColor = #00f
#---- Styles ------------------------------------------------------------------
#---- inTextField ----
# for leading/trailing components in text fields
[style]Button.inTextField = \
focusable: false; \
toolbar.margin: 1,1,1,1; \
toolbar.spacingInsets: 1,1,1,1