mirror of
https://github.com/damus-io/notedeck.git
synced 2024-09-19 21:26:33 +00:00
actionbar: support both dark and light buttons
since there is no way to do icon masks, we simply use two different textures for dark and light mode reply buttons. I used this command to create the dark mode button: convert reply.png -channel RGB -negate reply-dark.png Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
parent
f88b6d1dd4
commit
ea952c4c58
BIN
assets/icons/reply-dark.png
Normal file
BIN
assets/icons/reply-dark.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 912 B |
35
src/app.rs
35
src/app.rs
@ -681,23 +681,9 @@ fn render_note(
|
||||
render_reltime(ui, note_cache);
|
||||
});
|
||||
|
||||
let note_sidebar_size = 20.0;
|
||||
ui.add(NoteContents::new(damus, &txn, ¬e, note_key));
|
||||
|
||||
ui.horizontal(|ui| {
|
||||
let mut size = ui.available_size();
|
||||
size.x -= note_sidebar_size;
|
||||
|
||||
let contents = NoteContents::new(damus, &txn, ¬e, note_key);
|
||||
//let resp = render_note_contents(ui, damus, &txn, ¬e, note_key);
|
||||
//ui.allocate_space()
|
||||
//
|
||||
ui.add_sized(size, contents);
|
||||
|
||||
collapse_state.show_body_unindented(ui, |ui| {
|
||||
ui.set_width(note_sidebar_size);
|
||||
render_note_actionbar(ui)
|
||||
});
|
||||
});
|
||||
render_note_actionbar(ui);
|
||||
|
||||
//let header_res = ui.horizontal(|ui| {});
|
||||
});
|
||||
@ -716,13 +702,20 @@ fn render_note(
|
||||
}
|
||||
|
||||
fn render_note_actionbar(ui: &mut egui::Ui) -> egui::InnerResponse<()> {
|
||||
ui.vertical(|ui| {
|
||||
ui.horizontal(|ui| {
|
||||
let img_data = if ui.style().visuals.dark_mode {
|
||||
egui::include_image!("../assets/icons/reply.png")
|
||||
} else {
|
||||
egui::include_image!("../assets/icons/reply-dark.png")
|
||||
};
|
||||
|
||||
ui.spacing_mut().button_padding = egui::vec2(0.0, 0.0);
|
||||
if ui
|
||||
.add(
|
||||
egui::Button::image(egui::Image::new(egui::include_image!(
|
||||
"../assets/icons/reply.png"
|
||||
)))
|
||||
.fill(ui.style().visuals.panel_fill),
|
||||
egui::Button::image(egui::Image::new(img_data).max_width(10.0))
|
||||
//.stroke(egui::Stroke::NONE)
|
||||
.frame(false)
|
||||
.fill(ui.style().visuals.panel_fill),
|
||||
)
|
||||
.clicked()
|
||||
{}
|
||||
|
Loading…
Reference in New Issue
Block a user