diff --git a/Assets/common/icons.png b/Assets/common/icons.png index 9c6c4fdf..a37b1653 100644 Binary files a/Assets/common/icons.png and b/Assets/common/icons.png differ diff --git a/Assets/common/icons2x.png b/Assets/common/icons2x.png index e733ef49..18eaf4d5 100644 Binary files a/Assets/common/icons2x.png and b/Assets/common/icons2x.png differ diff --git a/Sources/arm/ui/UIToolbar.hx b/Sources/arm/ui/UIToolbar.hx index ac0c085c..7cc3c554 100644 --- a/Sources/arm/ui/UIToolbar.hx +++ b/Sources/arm/ui/UIToolbar.hx @@ -8,7 +8,7 @@ class UIToolbar { public static var inst: UIToolbar; - public static inline var defaultToolbarW = 54; + public static inline var defaultToolbarW = 36; public var toolbarHandle = new Handle(); public var toolbarw = defaultToolbarW; @@ -38,7 +38,7 @@ class UIToolbar { var ui = UISidebar.inst.ui; if (ui.window(toolbarHandle, 0, UIHeader.inst.headerh, toolbarw, System.windowHeight() - UIHeader.inst.headerh)) { - ui._y += 2; + ui._y += 1; ui.imageScrollAlign = false; var img = Res.get("icons.k"); @@ -60,8 +60,9 @@ class UIToolbar { for (i in 0...toolCount[SpacePaint]) { ui._x += 2; - if (Context.tool == i) ui.rect(-1, -1, 50 + 2, 50 + 2, ui.t.HIGHLIGHT_COL, 2); - if (ui.image(img, -1, null, i * imgw, 0, imgw, imgw) == State.Started) Context.selectTool(i); + if (Context.tool == i) ui.fill(-1, 2, 32 + 2, 32 + 2, ui.t.HIGHLIGHT_COL); + var rect = Res.tile50(img, i, 0); + if (ui.image(img, -1, null, rect.x, rect.y, rect.w, rect.h) == State.Started) Context.selectTool(i); if (ui.isHovered) ui.tooltip(tr(toolNames[i]) + " " + keys[i]); ui._x -= 2; ui._y += 2; @@ -69,14 +70,14 @@ class UIToolbar { } else if (UIHeader.inst.worktab.position == SpaceMaterial) { ui._x += 2; - if (Context.tool == ToolGizmo) ui.rect(-1, -1, 50 + 2, 50 + 2, ui.t.HIGHLIGHT_COL, 2); + if (Context.tool == ToolGizmo) ui.fill(-1, 2, 32 + 2, 32 + 2, ui.t.HIGHLIGHT_COL); if (ui.image(img, -1, null, imgw * 10, 0, imgw, imgw) == State.Started) Context.selectTool(ToolGizmo); if (ui.isHovered) ui.tooltip(tr("Gizmo") + " (G)"); ui._x -= 2; ui._y += 2; ui._x += 2; - if (Context.tool == ToolPicker) ui.rect(-1, -1, 50 + 2, 50 + 2, ui.t.HIGHLIGHT_COL, 2); + if (Context.tool == ToolPicker) ui.fill(-1, 2, 32 + 2, 32 + 2, ui.t.HIGHLIGHT_COL); if (ui.image(img, -1, null, imgw * 9, 0, imgw, imgw) == State.Started) Context.selectTool(ToolPicker); if (ui.isHovered) ui.tooltip(tr("Picker") + " (V)"); ui._x -= 2; @@ -84,7 +85,7 @@ class UIToolbar { } else if (UIHeader.inst.worktab.position == SpaceBake) { ui._x += 2; - if (Context.tool == ToolBake) ui.rect(-1, -1, 50 + 2, 50 + 2, ui.t.HIGHLIGHT_COL, 2); + if (Context.tool == ToolBake) ui.fill(-1, 2, 32 + 2, 32 + 2, ui.t.HIGHLIGHT_COL); if (ui.image(img, -1, null, imgw * 11, 0, imgw, imgw) == State.Started) Context.selectTool(ToolBake); if (ui.isHovered) ui.tooltip(tr("Bake") + " (K)"); ui._x -= 2; @@ -92,7 +93,7 @@ class UIToolbar { } else if (UIHeader.inst.worktab.position == SpaceRender) { ui._x += 2; - if (Context.tool == ToolGizmo) ui.rect(-1, -1, 50 + 2, 50 + 2, ui.t.HIGHLIGHT_COL, 2); + if (Context.tool == ToolGizmo) ui.fill(-1, 2, 32 + 2, 32 + 2, ui.t.HIGHLIGHT_COL); if (ui.image(img, -1, null, imgw * 10, 0, imgw, imgw) == State.Started) Context.selectTool(ToolGizmo); if (ui.isHovered) ui.tooltip(tr("Gizmo") + " (G)"); ui._x -= 2;