mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Fix search field offsets for search icon, cursor and empty text.
This commit is contained in:
+1
-1
@@ -33,7 +33,7 @@ public interface ExtendableTextComponent {
|
||||
return scale(5);
|
||||
}
|
||||
|
||||
default int getBeforeIconOffset() {
|
||||
default int getAfterIconOffset() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -213,10 +213,10 @@ public class PluginManagerConfigurableNew
|
||||
mySearchTextField.setBorder(JBUI.Borders.customLine(SEARCH_FIELD_BORDER_COLOR));
|
||||
|
||||
JBTextField editor = mySearchTextField.getTextEditor();
|
||||
editor.putClientProperty("JTextField.Search.Gap", JBUI.scale(-24));
|
||||
editor.putClientProperty("JTextField.Search.Gap", JBUI.scale(6));
|
||||
editor.putClientProperty("JTextField.Search.GapEmptyText", JBUI.scale(-1));
|
||||
editor.putClientProperty("StatusVisibleFunction", (BooleanFunction<JBTextField>)field -> field.getText().isEmpty());
|
||||
editor.setBorder(JBUI.Borders.empty(0, 25));
|
||||
editor.setBorder(JBUI.Borders.empty(0, 6));
|
||||
editor.setOpaque(true);
|
||||
editor.setBackground(SEARCH_BG_COLOR);
|
||||
}
|
||||
|
||||
+1
-1
@@ -112,7 +112,7 @@ public class PluginsGroupComponent extends JBPanelWithEmptyText {
|
||||
myGroups.add(groupIndex == -1 ? myGroups.size() : groupIndex, uiGroup);
|
||||
|
||||
OpaquePanel panel = new OpaquePanel(new BorderLayout(), SECTION_HEADER_BACKGROUND);
|
||||
panel.setBorder(JBUI.Borders.empty(4, 13));
|
||||
panel.setBorder(JBUI.Borders.empty(4, 10));
|
||||
|
||||
JLabel title = new JLabel(group.title) {
|
||||
@Override
|
||||
|
||||
+4
-6
@@ -128,14 +128,12 @@ public abstract class TextFieldWithPopupHandlerUI extends BasicTextFieldUI imple
|
||||
for (IconHolder holder : icons.values()) {
|
||||
int gap = holder.extension.getIconGap();
|
||||
if (holder.extension.isIconBeforeText()) {
|
||||
int offset = holder.extension.getBeforeIconOffset();
|
||||
bounds.x += offset;
|
||||
bounds.width -= offset;
|
||||
int offset = holder.extension.getAfterIconOffset();
|
||||
holder.bounds.x = bounds.x;
|
||||
bounds.width -= holder.bounds.width + gap;
|
||||
bounds.x += holder.bounds.width + gap;
|
||||
bounds.x += holder.bounds.width + gap + offset;
|
||||
|
||||
margin.left += offset + holder.bounds.width + gap;
|
||||
margin.left += holder.bounds.width + gap + offset;
|
||||
}
|
||||
else {
|
||||
bounds.width -= holder.bounds.width + gap;
|
||||
@@ -592,7 +590,7 @@ public abstract class TextFieldWithPopupHandlerUI extends BasicTextFieldUI imple
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBeforeIconOffset() {
|
||||
public int getAfterIconOffset() {
|
||||
Integer gap = (Integer)getComponent().getClientProperty("JTextField.Search.Gap");
|
||||
return gap == null ? 0 : gap;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user