Skip to content

Commit 56bc0fc

Browse files
authored
Merge pull request #13 from Aster-IDE/term
ok
2 parents 9fa5c27 + c0c69a4 commit 56bc0fc

9 files changed

Lines changed: 877 additions & 171 deletions

File tree

Cargo.lock

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

crates/command_palette/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ impl CommandPalette {
3333
ui.label(
3434
egui::RichText::new(">")
3535
.size(20.0)
36-
.color(CherryBlossomTheme::ACCENT_PINK),
36+
.color(CherryBlossomTheme::ACCENT_PINK()),
3737
);
3838

3939
let response = ui.text_edit_singleline(&mut self.query);
@@ -71,15 +71,15 @@ impl CommandPalette {
7171
ui.label(
7272
egui::RichText::new(name)
7373
.size(14.0)
74-
.color(CherryBlossomTheme::TEXT_PRIMARY),
74+
.color(CherryBlossomTheme::TEXT_PRIMARY()),
7575
);
7676

7777
ui.with_layout(
7878
egui::Layout::right_to_left(egui::Align::Center),
7979
|ui| {
8080
ui.label(
8181
egui::RichText::new(desc).size(12.0).color(
82-
CherryBlossomTheme::TEXT_MUTED,
82+
CherryBlossomTheme::TEXT_MUTED(),
8383
),
8484
);
8585
},

crates/editor/src/main.rs

Lines changed: 59 additions & 54 deletions
Large diffs are not rendered by default.

crates/search/src/lib.rs

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use theme::CherryBlossomTheme;
21

32
#[derive(Clone, Default, Debug)]
43
pub struct SearchState {
@@ -87,7 +86,7 @@ pub fn show_search_tab(ui: &mut egui::Ui, state: &mut SearchState, min_chars: us
8786
ui.label(
8887
egui::RichText::new("🔍")
8988
.size(16.0)
90-
.color(CherryBlossomTheme::TEXT_MUTED),
89+
.color(theme::CherryBlossomTheme::TEXT_MUTED()),
9190
);
9291

9392
ui.add_space(8.0);
@@ -114,9 +113,9 @@ pub fn show_search_tab(ui: &mut egui::Ui, state: &mut SearchState, min_chars: us
114113
ui.add_space(10.0);
115114

116115
let case_color = if state.case_sensitive {
117-
CherryBlossomTheme::ACCENT_PINK
116+
theme::CherryBlossomTheme::ACCENT_PINK()
118117
} else {
119-
CherryBlossomTheme::TEXT_MUTED
118+
theme::CherryBlossomTheme::TEXT_MUTED()
120119
};
121120
if ui
122121
.add(
@@ -129,9 +128,9 @@ pub fn show_search_tab(ui: &mut egui::Ui, state: &mut SearchState, min_chars: us
129128
}
130129

131130
let word_color = if state.whole_word {
132-
CherryBlossomTheme::ACCENT_PINK
131+
theme::CherryBlossomTheme::ACCENT_PINK()
133132
} else {
134-
CherryBlossomTheme::TEXT_MUTED
133+
theme::CherryBlossomTheme::TEXT_MUTED()
135134
};
136135
if ui
137136
.add(
@@ -144,9 +143,9 @@ pub fn show_search_tab(ui: &mut egui::Ui, state: &mut SearchState, min_chars: us
144143
}
145144

146145
let regex_color = if state.use_regex {
147-
CherryBlossomTheme::ACCENT_PINK
146+
theme::CherryBlossomTheme::ACCENT_PINK()
148147
} else {
149-
CherryBlossomTheme::TEXT_MUTED
148+
theme::CherryBlossomTheme::TEXT_MUTED()
150149
};
151150
if ui
152151
.add(
@@ -164,7 +163,7 @@ pub fn show_search_tab(ui: &mut egui::Ui, state: &mut SearchState, min_chars: us
164163
ui.label(
165164
egui::RichText::new("↔")
166165
.size(16.0)
167-
.color(CherryBlossomTheme::TEXT_MUTED),
166+
.color(theme::CherryBlossomTheme::TEXT_MUTED()),
168167
);
169168
ui.add_space(8.0);
170169
ui.add_sized(
@@ -184,10 +183,10 @@ pub fn show_search_tab(ui: &mut egui::Ui, state: &mut SearchState, min_chars: us
184183
egui::vec2(80.0, button_height),
185184
egui::Button::new(
186185
egui::RichText::new("Search")
187-
.color(CherryBlossomTheme::BG_DARKEST)
186+
.color(theme::CherryBlossomTheme::BG_DARKEST())
188187
.strong(),
189188
)
190-
.fill(CherryBlossomTheme::ACCENT_PINK),
189+
.fill(theme::CherryBlossomTheme::ACCENT_PINK()),
191190
);
192191
if search_btn.clicked() {
193192
ui.ctx().data_mut(|d| {
@@ -214,13 +213,13 @@ pub fn show_search_tab(ui: &mut egui::Ui, state: &mut SearchState, min_chars: us
214213
if !state.results.is_empty() {
215214
ui.label(
216215
egui::RichText::new(format!("{} matches", state.results.len()))
217-
.color(CherryBlossomTheme::TEXT_MUTED)
216+
.color(theme::CherryBlossomTheme::TEXT_MUTED())
218217
.size(12.0),
219218
);
220219
} else if !state.query.is_empty() {
221220
ui.label(
222221
egui::RichText::new("No results")
223-
.color(CherryBlossomTheme::TEXT_MUTED)
222+
.color(theme::CherryBlossomTheme::TEXT_MUTED())
224223
.size(12.0),
225224
);
226225
}
@@ -236,7 +235,7 @@ pub fn show_search_tab(ui: &mut egui::Ui, state: &mut SearchState, min_chars: us
236235
ui.centered_and_justified(|ui| {
237236
ui.label(
238237
egui::RichText::new("Enter a search query to find across open files")
239-
.color(CherryBlossomTheme::TEXT_MUTED)
238+
.color(theme::CherryBlossomTheme::TEXT_MUTED())
240239
.size(14.0),
241240
);
242241
});
@@ -251,7 +250,7 @@ pub fn show_search_tab(ui: &mut egui::Ui, state: &mut SearchState, min_chars: us
251250
ui.label(egui::RichText::new("📄 ").size(12.0));
252251
ui.label(
253252
egui::RichText::new(&result.file_path)
254-
.color(CherryBlossomTheme::ACCENT_PINK)
253+
.color(theme::CherryBlossomTheme::ACCENT_PINK())
255254
.size(12.0)
256255
.strong(),
257256
);
@@ -263,9 +262,9 @@ pub fn show_search_tab(ui: &mut egui::Ui, state: &mut SearchState, min_chars: us
263262
let is_current = i == state.current_result;
264263

265264
let bg_color = if is_current {
266-
CherryBlossomTheme::BG_DARK
265+
theme::CherryBlossomTheme::BG_DARK()
267266
} else {
268-
CherryBlossomTheme::BG_DARKEST
267+
theme::CherryBlossomTheme::BG_DARKEST()
269268
};
270269

271270
let response = egui::Frame::new()
@@ -277,7 +276,7 @@ pub fn show_search_tab(ui: &mut egui::Ui, state: &mut SearchState, min_chars: us
277276
egui::vec2(50.0, 18.0),
278277
egui::Label::new(
279278
egui::RichText::new(format!("{}", result.line))
280-
.color(CherryBlossomTheme::TEXT_MUTED)
279+
.color(theme::CherryBlossomTheme::TEXT_MUTED())
281280
.monospace()
282281
.size(12.0),
283282
),
@@ -301,18 +300,18 @@ pub fn show_search_tab(ui: &mut egui::Ui, state: &mut SearchState, min_chars: us
301300
ui.horizontal(|ui| {
302301
ui.monospace(
303302
egui::RichText::new(before)
304-
.color(CherryBlossomTheme::TEXT_SECONDARY)
303+
.color(theme::CherryBlossomTheme::TEXT_SECONDARY())
305304
.size(12.0),
306305
);
307306
ui.monospace(
308307
egui::RichText::new(matched)
309-
.color(CherryBlossomTheme::ACCENT_HOT)
308+
.color(theme::CherryBlossomTheme::ACCENT_HOT())
310309
.strong()
311310
.size(12.0),
312311
);
313312
ui.monospace(
314313
egui::RichText::new(after)
315-
.color(CherryBlossomTheme::TEXT_SECONDARY)
314+
.color(theme::CherryBlossomTheme::TEXT_SECONDARY())
316315
.size(12.0),
317316
);
318317
});
@@ -341,12 +340,12 @@ pub fn show_search_button(ui: &mut egui::Ui) {
341340
ui.label(
342341
egui::RichText::new("🔍")
343342
.size(32.0)
344-
.color(CherryBlossomTheme::TEXT_MUTED),
343+
.color(theme::CherryBlossomTheme::TEXT_MUTED()),
345344
);
346345
ui.add_space(10.0);
347346
ui.label(
348347
egui::RichText::new("Click the search icon above\nor press Ctrl+Shift+F")
349-
.color(CherryBlossomTheme::TEXT_MUTED)
348+
.color(theme::CherryBlossomTheme::TEXT_MUTED())
350349
.size(11.0),
351350
);
352351
});

0 commit comments

Comments
 (0)