Skip to content

Commit 301126a

Browse files
committed
wip
1 parent 32ca386 commit 301126a

4 files changed

Lines changed: 17 additions & 17 deletions

File tree

oxirun/Cargo.lock

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

oxirun/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ license = "GPL-3.0-only"
77

88
[dependencies]
99
oxilib = "0.1.2"
10-
oxiced = "0.4.0"
10+
# oxiced = "0.4.0"
11+
oxiced = { version = "0.4.0", path = "/home/dashie/gits/oxiced" }
1112
iced = { version = "0.13.1", features = ["advanced", "canvas", "image", "svg"] }
1213
iced_layershell = "0.12.0" # broken on later versions
1314
xdg = "3.0.0"

oxirun/src/main.rs

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ use iced::keyboard::Modifiers;
55
use iced::keyboard::key::Named;
66
use iced::widget::{Column, Row, button, text};
77
use iced::{Element, Length, Subscription, Task, Theme, event};
8-
use oxiced::theme::get_theme;
9-
use oxiced::widgets::common::{darken_color, lighten_color};
8+
use oxiced::theme::theme::{get_derived_iced_theme, OXITHEME};
109
use oxiced::widgets::oxi_button::{self, ButtonVariant};
1110
use oxiced::widgets::oxi_text_input::text_input;
1211

@@ -57,7 +56,7 @@ struct OxiRun {
5756
impl Default for OxiRun {
5857
fn default() -> Self {
5958
Self {
60-
theme: get_theme(),
59+
theme: get_derived_iced_theme(),
6160
filter_text: "".into(),
6261
plugins: HashMap::new(),
6362
current_focus: 0,
@@ -136,14 +135,14 @@ fn content_button(
136135
.on_press(Message::LaunchEntry(current_index))
137136
.style(move |theme, status| {
138137
let is_focused = current_index == focused_index;
139-
let palette = theme.extended_palette().primary;
140-
let default_style = oxi_button::primary_button(theme, status);
138+
let palette = OXITHEME;
139+
let default_style = oxi_button::row_entry(theme, status);
141140
let background = if status == button::Status::Hovered {
142-
Some(iced::Background::Color(darken_color(palette.base.color)))
141+
Some(iced::Background::Color(palette.secondary_bg_active))
143142
} else if is_focused {
144-
default_style.background
143+
Some(iced::Background::Color(palette.secondary_bg_hover))
145144
} else {
146-
Some(iced::Background::Color(lighten_color(palette.base.color)))
145+
Some(iced::Background::Color(palette.secondary_bg))
147146
};
148147
iced::widget::button::Style {
149148
background,
@@ -351,11 +350,11 @@ impl Application for OxiRun {
351350
}
352351

353352
// remove the annoying background color
354-
fn style(&self, theme: &Self::Theme) -> iced_layershell::Appearance {
355-
let palette = theme.extended_palette();
353+
fn style(&self, _: &Self::Theme) -> iced_layershell::Appearance {
354+
let palette = OXITHEME;
356355
iced_layershell::Appearance {
357356
background_color: iced::Color::TRANSPARENT,
358-
text_color: palette.background.base.text,
357+
text_color: palette.text
359358
}
360359
}
361360

oxirun/src/utils.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use iced::{
22
Alignment, Element, Length, Renderer, Theme, widget::container, widget::container::Style,
33
};
4+
use oxiced::theme::theme::OXITHEME;
45

56
use crate::Message;
67

@@ -37,12 +38,12 @@ impl FocusDirection {
3738
}
3839

3940
fn box_style(theme: &Theme) -> Style {
40-
let palette = theme.extended_palette();
41+
let palette = OXITHEME;
4142
Style {
4243
background: Some(iced::Background::Color(
43-
palette.background.base.color,
44+
palette.base
4445
)),
45-
border: iced::border::color(palette.primary.strong.color).width(5).rounded(10),
46+
border: iced::border::color(palette.primary).width(5).rounded(palette.border_radius),
4647
..container::rounded_box(theme)
4748
}
4849
}

0 commit comments

Comments
 (0)