-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
142 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
## [Unreleased] | ||
|
||
- update libcosmic | ||
- add pages | ||
|
||
## [0.1.0] - 2024-11-19 | ||
|
||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#![allow(dead_code)] | ||
|
||
use cosmic::{ | ||
iced_core::Length, | ||
widget::{self, icon::Handle, Icon, IconButton}, | ||
}; | ||
|
||
pub static ICON_LENGTH: Length = Length::Fixed(25.0); | ||
|
||
#[macro_export] | ||
macro_rules! icon_handle { | ||
($name:literal) => {{ | ||
let bytes = include_bytes!(concat!("../res/icons/", $name, ".svg")); | ||
cosmic::widget::icon::from_svg_bytes(bytes).symbolic(true) | ||
}}; | ||
} | ||
|
||
#[macro_export] | ||
macro_rules! icon { | ||
($name:literal) => {{ | ||
use $crate::icon::ICON_LENGTH; | ||
use $crate::icon_handle; | ||
|
||
cosmic::widget::icon::icon(icon_handle!($name)) | ||
.height(ICON_LENGTH) | ||
.width(ICON_LENGTH) | ||
}}; | ||
} | ||
#[macro_export] | ||
macro_rules! icon_button { | ||
($name:literal) => {{ | ||
use $crate::icon_handle; | ||
cosmic::widget::button::icon(icon_handle!($name)) | ||
}}; | ||
} | ||
|
||
pub fn icon_from_handle(handle: Handle) -> Icon { | ||
widget::icon::icon(handle) | ||
.height(ICON_LENGTH) | ||
.width(ICON_LENGTH) | ||
} | ||
|
||
pub fn icon_button_from_handle<'a, M>(handle: Handle) -> IconButton<'a, M> { | ||
cosmic::widget::button::icon(handle) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ mod app; | |
mod clipboard; | ||
mod config; | ||
mod db; | ||
mod icon; | ||
mod localize; | ||
mod message; | ||
mod navigation; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters