Skip to content

Commit cc1e0ba

Browse files
committed
Default to primary color for icon SVGs.
1 parent 1dae16c commit cc1e0ba

4 files changed

Lines changed: 48 additions & 45 deletions

File tree

src/buffer/input_view.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -581,10 +581,7 @@ pub fn view<'a>(
581581
.into()
582582
} else {
583583
let t = state.upload_anim * std::f32::consts::TAU;
584-
let spinner = crate::icon::spinner(t + 0.4 * t.sin())
585-
.style(|theme: &Theme, _| iced::widget::svg::Style {
586-
color: Some(theme.styles().text.primary.color),
587-
});
584+
let spinner = crate::icon::spinner(t + 0.4 * t.sin());
588585
if state.uploading > 1 {
589586
row![spinner, text(state.uploading).size(12)]
590587
.align_y(iced::Alignment::Center)

src/icon.rs

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,21 @@ pub fn connected<'a>() -> Svg<'a, Theme> {
1717
let entypo_globe =
1818
include_bytes!("../assets/fontello/entypo-globe.svg").to_vec();
1919

20-
svg(svg::Handle::from_memory(entypo_globe))
20+
svg(svg::Handle::from_memory(entypo_globe)).style(theme::svg::primary)
2121
}
2222

2323
pub fn disconnected<'a>() -> Svg<'a, Theme> {
2424
let entypo_cancel =
2525
include_bytes!("../assets/fontello/entypo-cancel.svg").to_vec();
2626

27-
svg(svg::Handle::from_memory(entypo_cancel))
27+
svg(svg::Handle::from_memory(entypo_cancel)).style(theme::svg::primary)
2828
}
2929

3030
pub fn link<'a>() -> Svg<'a, Theme> {
3131
let entypo_link =
3232
include_bytes!("../assets/fontello/entypo-link.svg").to_vec();
3333

34-
svg(svg::Handle::from_memory(entypo_link))
34+
svg(svg::Handle::from_memory(entypo_link)).style(theme::svg::primary)
3535
}
3636

3737
pub fn cancel<'a>() -> Text<'a> {
@@ -58,7 +58,7 @@ pub fn search<'a>() -> Svg<'a, Theme> {
5858
let entypo_search =
5959
include_bytes!("../assets/fontello/entypo-search.svg").to_vec();
6060

61-
svg(svg::Handle::from_memory(entypo_search))
61+
svg(svg::Handle::from_memory(entypo_search)).style(theme::svg::primary)
6262
}
6363

6464
pub fn checkmark<'a>() -> Text<'a> {
@@ -69,28 +69,28 @@ pub fn file_transfer<'a>() -> Svg<'a, Theme> {
6969
let entypo_download =
7070
include_bytes!("../assets/fontello/entypo-download.svg").to_vec();
7171

72-
svg(svg::Handle::from_memory(entypo_download))
72+
svg(svg::Handle::from_memory(entypo_download)).style(theme::svg::primary)
7373
}
7474

7575
pub fn refresh<'a>() -> Svg<'a, Theme> {
7676
let entypo_arrows_ccw =
7777
include_bytes!("../assets/fontello/entypo-arrows-ccw.svg").to_vec();
7878

79-
svg(svg::Handle::from_memory(entypo_arrows_ccw))
79+
svg(svg::Handle::from_memory(entypo_arrows_ccw)).style(theme::svg::primary)
8080
}
8181

8282
pub fn megaphone<'a>() -> Svg<'a, Theme> {
8383
let entypo_megaphone =
8484
include_bytes!("../assets/fontello/entypo-megaphone.svg").to_vec();
8585

86-
svg(svg::Handle::from_memory(entypo_megaphone))
86+
svg(svg::Handle::from_memory(entypo_megaphone)).style(theme::svg::primary)
8787
}
8888

8989
pub fn theme_editor<'a>() -> Svg<'a, Theme> {
9090
let entypo_palette =
9191
include_bytes!("../assets/fontello/entypo-palette.svg").to_vec();
9292

93-
svg(svg::Handle::from_memory(entypo_palette))
93+
svg(svg::Handle::from_memory(entypo_palette)).style(theme::svg::primary)
9494
}
9595

9696
pub fn undo<'a>() -> Text<'a> {
@@ -109,28 +109,28 @@ pub fn logs<'a>() -> Svg<'a, Theme> {
109109
let entypo_bucket =
110110
include_bytes!("../assets/fontello/entypo-bucket.svg").to_vec();
111111

112-
svg(svg::Handle::from_memory(entypo_bucket))
112+
svg(svg::Handle::from_memory(entypo_bucket)).style(theme::svg::primary)
113113
}
114114

115115
pub fn menu<'a>() -> Svg<'a, Theme> {
116116
let typicons_menu =
117117
include_bytes!("../assets/fontello/typicons-menu.svg").to_vec();
118118

119-
svg(svg::Handle::from_memory(typicons_menu))
119+
svg(svg::Handle::from_memory(typicons_menu)).style(theme::svg::primary)
120120
}
121121

122122
pub fn documentation<'a>() -> Svg<'a, Theme> {
123123
let fontawesome_book =
124124
include_bytes!("../assets/fontello/fontawesome-book.svg").to_vec();
125125

126-
svg(svg::Handle::from_memory(fontawesome_book))
126+
svg(svg::Handle::from_memory(fontawesome_book)).style(theme::svg::primary)
127127
}
128128

129129
pub fn highlights<'a>() -> Svg<'a, Theme> {
130130
let entypo_bell =
131131
include_bytes!("../assets/fontello/entypo-bell.svg").to_vec();
132132

133-
svg(svg::Handle::from_memory(entypo_bell))
133+
svg(svg::Handle::from_memory(entypo_bell)).style(theme::svg::primary)
134134
}
135135

136136
pub fn scroll_to_bottom<'a>() -> Text<'a> {
@@ -150,6 +150,7 @@ pub fn config<'a>() -> Svg<'a, Theme> {
150150
include_bytes!("../assets/fontello/fontawesome-file-code.svg").to_vec();
151151

152152
svg(svg::Handle::from_memory(fontawesome_file_code))
153+
.style(theme::svg::primary)
153154
}
154155

155156
pub fn open<'a>() -> Text<'a> {
@@ -160,7 +161,7 @@ pub fn star<'a>() -> Svg<'a, Theme> {
160161
let fontawesome_star =
161162
include_bytes!("../assets/fontello/fontawesome-star.svg").to_vec();
162163

163-
svg(svg::Handle::from_memory(fontawesome_star))
164+
svg(svg::Handle::from_memory(fontawesome_star)).style(theme::svg::primary)
164165
}
165166

166167
pub fn certificate<'a>() -> Svg<'a, Theme> {
@@ -169,13 +170,14 @@ pub fn certificate<'a>() -> Svg<'a, Theme> {
169170
.to_vec();
170171

171172
svg(svg::Handle::from_memory(fontawesome_certificate))
173+
.style(theme::svg::primary)
172174
}
173175

174176
pub fn circle<'a>() -> Svg<'a, Theme> {
175177
let fontawesome_circle =
176178
include_bytes!("../assets/fontello/fontawesome-circle.svg").to_vec();
177179

178-
svg(svg::Handle::from_memory(fontawesome_circle))
180+
svg(svg::Handle::from_memory(fontawesome_circle)).style(theme::svg::primary)
179181
}
180182

181183
pub fn circle_empty<'a>() -> Svg<'a, Theme> {
@@ -184,6 +186,7 @@ pub fn circle_empty<'a>() -> Svg<'a, Theme> {
184186
.to_vec();
185187

186188
svg(svg::Handle::from_memory(fontawesome_circle_empty))
189+
.style(theme::svg::primary)
187190
}
188191

189192
pub fn dot_circled<'a>() -> Svg<'a, Theme> {
@@ -192,41 +195,44 @@ pub fn dot_circled<'a>() -> Svg<'a, Theme> {
192195
.to_vec();
193196

194197
svg(svg::Handle::from_memory(fontawesome_dot_circled))
198+
.style(theme::svg::primary)
195199
}
196200

197201
pub fn asterisk<'a>() -> Svg<'a, Theme> {
198202
let fontawesome_asterisk =
199203
include_bytes!("../assets/fontello/fontawesome-asterisk.svg").to_vec();
200204

201205
svg(svg::Handle::from_memory(fontawesome_asterisk))
206+
.style(theme::svg::primary)
202207
}
203208

204209
pub fn speaker<'a>() -> Svg<'a, Theme> {
205210
let entypo_sound =
206211
include_bytes!("../assets/fontello/entypo-sound.svg").to_vec();
207212

208-
svg(svg::Handle::from_memory(entypo_sound))
213+
svg(svg::Handle::from_memory(entypo_sound)).style(theme::svg::primary)
209214
}
210215

211216
pub fn lightbulb<'a>() -> Svg<'a, Theme> {
212217
let fontawesome_lightbulb =
213218
include_bytes!("../assets/fontello/fontawesome-lightbulb.svg").to_vec();
214219

215220
svg(svg::Handle::from_memory(fontawesome_lightbulb))
221+
.style(theme::svg::primary)
216222
}
217223

218224
pub fn quit<'a>() -> Svg<'a, Theme> {
219225
let mfg_labs_logout =
220226
include_bytes!("../assets/fontello/mfg-labs-logout.svg").to_vec();
221227

222-
svg(svg::Handle::from_memory(mfg_labs_logout))
228+
svg(svg::Handle::from_memory(mfg_labs_logout)).style(theme::svg::primary)
223229
}
224230

225231
pub fn channel_discovery<'a>() -> Svg<'a, Theme> {
226232
let fontawesome_users =
227233
include_bytes!("../assets/fontello/fontawesome-users.svg").to_vec();
228234

229-
svg(svg::Handle::from_memory(fontawesome_users))
235+
svg(svg::Handle::from_memory(fontawesome_users)).style(theme::svg::primary)
230236
}
231237

232238
pub fn plus<'a>() -> Text<'a> {
@@ -246,6 +252,7 @@ pub fn not_sent<'a>() -> Svg<'a, Theme> {
246252
include_bytes!("../assets/fontello/fontawesome-attention.svg").to_vec();
247253

248254
svg(svg::Handle::from_memory(fontawesome_attention))
255+
.style(theme::svg::primary)
249256
}
250257

251258
pub fn eraser<'a>() -> Text<'a> {
@@ -259,6 +266,7 @@ pub fn spinner<'a>(angle: f32) -> Svg<'a, Theme> {
259266
.width(15)
260267
.height(15)
261268
.rotation(iced::Radians(angle))
269+
.style(theme::svg::primary)
262270
}
263271

264272
fn to_text<'a>(unicode: char) -> Text<'a> {

src/modal/image_preview.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,7 @@ pub fn view<'a>(
3131
icon::checkmark()
3232
.style(theme::text::success)
3333
),
34-
_ => Element::from(
35-
icon::file_transfer()
36-
.style(theme::svg::primary)
37-
),
34+
_ => Element::from(icon::file_transfer()),
3835
}
3936
))
4037
.padding(5)

src/screen/dashboard/sidebar.rs

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ impl Sidebar {
234234
.contains(&config::sidebar::InternalBuffer::Logs));
235235
let system_information = self.system_information.clone();
236236

237-
let icon = icon::menu().style(theme::svg::primary);
237+
let icon = icon::menu();
238238

239239
let badge = if show_notification_dot {
240240
Some((
@@ -324,19 +324,19 @@ impl Sidebar {
324324
Menu::QuitApplication => context_button(
325325
text("Quit Halloy"),
326326
Some(&keyboard.quit_application),
327-
icon::quit().style(theme::svg::primary),
327+
icon::quit(),
328328
Message::QuitApplication,
329329
),
330330
Menu::RefreshConfig => context_button(
331331
text("Reload config file"),
332332
Some(&keyboard.reload_configuration),
333-
icon::refresh().style(theme::svg::primary),
333+
icon::refresh(),
334334
Message::ReloadConfigFile,
335335
),
336336
Menu::CommandBar => context_button(
337337
text("Command Bar"),
338338
Some(&keyboard.command_bar),
339-
icon::search().style(theme::svg::primary),
339+
icon::search(),
340340
Message::ToggleCommandBar,
341341
),
342342
Menu::FileTransfers => context_button(
@@ -368,16 +368,15 @@ impl Sidebar {
368368
Menu::Highlights => context_button(
369369
text("Highlights"),
370370
Some(&keyboard.highlights),
371-
icon::highlights().style(theme::svg::primary),
371+
icon::highlights(),
372372
Message::ToggleInternalBuffer(
373373
buffer::Internal::Highlights,
374374
),
375375
),
376376
Menu::ChannelDiscovery => context_button(
377377
text("Channel Discovery"),
378378
None,
379-
icon::channel_discovery()
380-
.style(theme::svg::primary),
379+
icon::channel_discovery(),
381380
Message::ToggleInternalBuffer(
382381
buffer::Internal::ChannelDiscovery(None),
383382
),
@@ -409,7 +408,7 @@ impl Sidebar {
409408
Menu::ThemeEditor => context_button(
410409
text("Theme Editor"),
411410
Some(&keyboard.theme_editor),
412-
icon::theme_editor().style(theme::svg::primary),
411+
icon::theme_editor(),
413412
Message::ToggleThemeEditor,
414413
),
415414
Menu::HorizontalRule => match length {
@@ -432,7 +431,7 @@ impl Sidebar {
432431
Menu::Version => context_button(
433432
text("About Halloy"),
434433
None,
435-
icon::documentation().style(theme::svg::primary),
434+
icon::documentation(),
436435
Message::OpenAbout {
437436
version: version.current.clone(),
438437
commit: data::environment::GIT_HASH
@@ -446,13 +445,13 @@ impl Sidebar {
446445
Menu::Documentation => context_button(
447446
text("Documentation"),
448447
None,
449-
icon::documentation().style(theme::svg::primary),
448+
icon::documentation(),
450449
Message::OpenDocumentation,
451450
),
452451
Menu::ConfigEditor => context_button(
453452
text("Config Editor"),
454453
Some(&keyboard.open_config_editor),
455-
icon::config().style(theme::svg::primary),
454+
icon::config(),
456455
Message::ToggleInternalBuffer(
457456
buffer::Internal::ConfigEditor,
458457
),
@@ -646,6 +645,12 @@ impl Sidebar {
646645
internal_buffers
647646
.push(button(buffer::Internal::Logs, "Logs"));
648647
}
648+
config::sidebar::InternalBuffer::ConfigEditor => {
649+
internal_buffers.push(button(
650+
buffer::Internal::ConfigEditor,
651+
"Config Editor",
652+
));
653+
}
649654
}
650655
}
651656

@@ -1027,14 +1032,11 @@ fn upstream_buffer_button<'a>(
10271032
{
10281033
Some(Icon::Upstream(server_icon))
10291034
} else {
1030-
Some(Icon::Internal(
1031-
if server.is_bouncer_network() {
1032-
icon::link()
1033-
} else {
1034-
icon::connected()
1035-
}
1036-
.style(theme::svg::primary),
1037-
))
1035+
Some(Icon::Internal(if server.is_bouncer_network() {
1036+
icon::link()
1037+
} else {
1038+
icon::connected()
1039+
}))
10381040
}
10391041
} else {
10401042
None
@@ -1567,7 +1569,6 @@ fn sidebar_icon<'a>(
15671569
image::from_data(server_icon, true, ContentFit::Contain)
15681570
}
15691571
Icon::Internal(icon) => icon
1570-
.style(theme::svg::primary)
15711572
.width(Length::Shrink)
15721573
.content_fit(ContentFit::Contain)
15731574
.into(),

0 commit comments

Comments
 (0)