add logo to side panel
Signed-off-by: kernelkind <kernelkind@gmail.com>
This commit is contained in:
committed by
William Casarin
parent
e60793ff37
commit
9c572e18a3
@@ -40,6 +40,7 @@ pub enum SidePanelAction {
|
||||
Columns,
|
||||
ComposeNote,
|
||||
Search,
|
||||
ExpandSidePanel,
|
||||
}
|
||||
|
||||
pub struct SidePanelResponse {
|
||||
@@ -86,13 +87,20 @@ impl<'a> DesktopSidePanel<'a> {
|
||||
.vertical(|ui| {
|
||||
let top_resp = ui
|
||||
.with_layout(Layout::top_down(egui::Align::Center), |ui| {
|
||||
let expand_resp = ui.add(expand_side_panel_button());
|
||||
ui.add_space(28.0);
|
||||
let compose_resp = ui.add(compose_note_button());
|
||||
let search_resp = ui.add(search_button());
|
||||
let column_resp = ui.add(add_column_button(dark_mode));
|
||||
|
||||
ui.add(Separator::default().horizontal().spacing(8.0).shrink(4.0));
|
||||
|
||||
if compose_resp.clicked() {
|
||||
if expand_resp.clicked() {
|
||||
Some(InnerResponse::new(
|
||||
SidePanelAction::ExpandSidePanel,
|
||||
expand_resp,
|
||||
))
|
||||
} else if compose_resp.clicked() {
|
||||
Some(InnerResponse::new(
|
||||
SidePanelAction::ComposeNote,
|
||||
compose_resp,
|
||||
@@ -198,6 +206,10 @@ impl<'a> DesktopSidePanel<'a> {
|
||||
// TODO
|
||||
info!("Clicked search button");
|
||||
}
|
||||
SidePanelAction::ExpandSidePanel => {
|
||||
// TODO
|
||||
info!("Clicked expand side panel button");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -331,6 +343,17 @@ fn search_button() -> impl Widget {
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: convert to responsive button when expanded side panel impl is finished
|
||||
fn expand_side_panel_button() -> impl Widget {
|
||||
|ui: &mut egui::Ui| -> egui::Response {
|
||||
let img_size = 40.0;
|
||||
let img_data = egui::include_image!("../../assets/damus_rounded.svg");
|
||||
let img = egui::Image::new(img_data).max_width(img_size);
|
||||
|
||||
ui.add(img)
|
||||
}
|
||||
}
|
||||
|
||||
mod preview {
|
||||
|
||||
use egui_extras::{Size, StripBuilder};
|
||||
|
||||
Reference in New Issue
Block a user