-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add a prettier txid output to receive success
- Loading branch information
1 parent
ee60537
commit 2d53f70
Showing
8 changed files
with
217 additions
and
131 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,13 +1,19 @@ | ||
use iced::widget::{container, scrollable, Column}; | ||
use iced::widget::{container, horizontal_space, row, scrollable, Column}; | ||
use iced::Length; | ||
use iced::{Element, Padding}; | ||
|
||
use crate::Message; | ||
|
||
pub fn basic_layout(column: Column<Message>) -> Element<Message> { | ||
container( | ||
scrollable(column.width(Length::Fixed(512.)).padding(Padding::new(48.))) | ||
.height(Length::Fill), | ||
scrollable(row![ | ||
column | ||
.width(Length::Fixed(512.)) | ||
.padding(Padding::new(48.)) | ||
.max_width(512), | ||
horizontal_space(), | ||
]) | ||
.height(Length::Fill), | ||
) | ||
.into() | ||
} |
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,39 @@ | ||
use iced::{ | ||
widget::{ | ||
button::{self, Status}, Button, | ||
}, | ||
Border, Color, Length, Shadow, Theme, | ||
}; | ||
|
||
use crate::Message; | ||
|
||
use super::{darken, lighten, map_icon, SvgIcon}; | ||
|
||
pub fn mini_copy(text: String) -> Button<'static, Message, Theme> { | ||
let icon = map_icon(SvgIcon::Copy, 24., 24.); | ||
|
||
Button::new(icon) | ||
.on_press(Message::CopyToClipboard(text.to_string())) | ||
.style(|theme: &Theme, status| { | ||
let border = Border { | ||
color: Color::WHITE, | ||
width: 0., | ||
radius: (8.).into(), | ||
}; | ||
|
||
let background = match status { | ||
Status::Hovered => lighten(theme.palette().background, 0.1), | ||
Status::Pressed => darken(Color::BLACK, 0.1), | ||
_ => theme.palette().background, | ||
}; | ||
button::Style { | ||
background: Some(background.into()), | ||
text_color: Color::WHITE, | ||
border, | ||
shadow: Shadow::default(), | ||
} | ||
}) | ||
.padding(6) | ||
.width(Length::Fixed(32.)) | ||
.height(Length::Fixed(32.)) | ||
} |
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 |
---|---|---|
|
@@ -39,3 +39,6 @@ pub use rules::*; | |
|
||
mod layout; | ||
pub use layout::*; | ||
|
||
mod mini_copy; | ||
pub use mini_copy::*; |
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
Oops, something went wrong.