@@ -89,17 +89,19 @@ function Window:process(Icons) -- {{{
89
89
local unfocused_color = {white = 0.9 , alpha = 0.30 }
90
90
local focused_color = {white = 0.9 , alpha = 0.99 }
91
91
local padding = 4
92
+ local iconPadding = 4
92
93
local aspectRatio = 5
93
- local size = 25
94
+ local size = 32
94
95
95
- local width = showIcons and size or (size / aspectRatio )
96
+ local offsetY = 2
97
+ local offsetX = 4
96
98
99
+ local width = showIcons and size or (size / aspectRatio )
97
100
local currTabIdx = self .stackIdx
98
- local xval = self .frame .x - (width + padding )
99
101
100
102
self .canvas_frame = {
101
- x = xval ,
102
- y = self .frame .y + 2 ,
103
+ x = self . frame . x - ( width + offsetX ) ,
104
+ y = self .frame .y + offsetY ,
103
105
w = self .frame .w ,
104
106
h = self .frame .h ,
105
107
}
@@ -111,6 +113,13 @@ function Window:process(Icons) -- {{{
111
113
h = size ,
112
114
}
113
115
116
+ self .icon_rect = {
117
+ x = iconPadding ,
118
+ y = self .indicator_rect .y + iconPadding ,
119
+ w = self .indicator_rect .w - (iconPadding * 2 ),
120
+ h = self .indicator_rect .h - (iconPadding * 2 ),
121
+ }
122
+
114
123
local focused = self :isFocused ()
115
124
116
125
self .color_opts = {
@@ -135,23 +144,29 @@ function Window:draw_indicator() -- {{{
135
144
136
145
self .indicator = hs .canvas .new (self .canvas_frame )
137
146
147
+ local showIcons = wsi .getShowIconsState ()
138
148
local width = self .indicator_rect .w
149
+
150
+ -- TODO: configurable roundness radius for icons & pills
151
+ local radius = showIcons and (self .indicator_rect .w / 4.0 ) or 3.0
152
+
139
153
self .indicator :appendElements {
140
154
type = " rectangle" ,
141
155
action = " fill" ,
142
156
fillColor = self .color_opts .bg ,
143
157
frame = self .indicator_rect ,
144
- roundedRectRadii = {xRadius = 2.0 , yRadius = 2.0 },
158
+ roundedRectRadii = {xRadius = radius , yRadius = radius },
145
159
}
146
160
147
- if wsi . getShowIconsState () then
161
+ if showIcons then
148
162
self .indicator :appendElements {
149
163
type = " image" ,
150
164
image = self :iconFromAppName (),
151
- frame = self .indicator_rect ,
165
+ frame = self .icon_rect ,
152
166
imageAlpha = self .color_opts .imageAlpha ,
153
167
}
154
168
end
169
+
155
170
self .indicator :show ()
156
171
end -- }}}
157
172
0 commit comments