Design improvements
This commit is contained in:
parent
cb9bc5f8db
commit
b7a469ee02
|
|
@ -0,0 +1 @@
|
||||||
|
<?xml version="1.0" ?><svg width="16px" height="16px" viewBox="0 0 35 35" data-name="Layer 2" id="e8de1841-eb36-4a1b-bc66-894a956e3d92" xmlns="http://www.w3.org/2000/svg"><path fill="black" d="M17.505,34.727a17.227,17.227,0,1,1,15.859-23.9,1.25,1.25,0,0,1-2.3.969,14.727,14.727,0,1,0-7.873,19.282,1.25,1.25,0,0,1,.969,2.305A17.127,17.127,0,0,1,17.505,34.727Z"/><path fill="black" d="M33.426,13.217h-.01l-9.788-.075a1.25,1.25,0,0,1,.009-2.5h.009l8.539.065.065-8.538A1.25,1.25,0,0,1,33.5.929h.009A1.249,1.249,0,0,1,34.75,2.188l-.074,9.788A1.251,1.251,0,0,1,33.426,13.217Z"/></svg>
|
||||||
|
After Width: | Height: | Size: 579 B |
|
|
@ -15,7 +15,7 @@ pub(crate) struct Args {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, ArgEnum)]
|
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, ArgEnum)]
|
||||||
pub(crate) enum Themes {
|
pub enum Themes {
|
||||||
Classic,
|
Classic,
|
||||||
/// Windows 7
|
/// Windows 7
|
||||||
Aero,
|
Aero,
|
||||||
|
|
|
||||||
|
|
@ -40,9 +40,9 @@ pub(crate) struct ConfigWindow {
|
||||||
impl ConfigWindow {
|
impl ConfigWindow {
|
||||||
pub(crate) fn new() -> Self {
|
pub(crate) fn new() -> Self {
|
||||||
let mut win = Window::new(0, 0, 500, 300, "Config").center_screen();
|
let mut win = Window::new(0, 0, 500, 300, "Config").center_screen();
|
||||||
if let Ok(image) = SvgImage::from_data(&globals::ICON) {
|
win.set_icon(Some(
|
||||||
win.set_icon(Some(image));
|
SvgImage::from_data(globals::ICON.to_str().unwrap()).unwrap(),
|
||||||
}
|
));
|
||||||
|
|
||||||
let mut col = Flex::default().with_size(490, 290).with_pos(5, 5).column();
|
let mut col = Flex::default().with_size(490, 290).with_pos(5, 5).column();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,9 +32,9 @@ pub(crate) struct Page {
|
||||||
impl CropWindow {
|
impl CropWindow {
|
||||||
pub(crate) fn new() -> Self {
|
pub(crate) fn new() -> Self {
|
||||||
let mut win = Window::new(0, 0, 500, 600, "Crop").center_screen();
|
let mut win = Window::new(0, 0, 500, 600, "Crop").center_screen();
|
||||||
if let Ok(image) = SvgImage::from_data(&globals::ICON) {
|
win.set_icon(Some(
|
||||||
win.set_icon(Some(image));
|
SvgImage::from_data(globals::ICON.to_str().unwrap()).unwrap(),
|
||||||
}
|
));
|
||||||
|
|
||||||
let mut main_flex = Flex::default().size_of_parent().column();
|
let mut main_flex = Flex::default().size_of_parent().column();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,10 @@
|
||||||
use crate::config;
|
use crate::config;
|
||||||
use lazy_static::lazy_static;
|
use lazy_static::lazy_static;
|
||||||
use rusttype::Font;
|
use rusttype::Font;
|
||||||
use std::{io::Read, sync::RwLock};
|
use std::{ffi::OsString, io::Read, sync::RwLock};
|
||||||
|
|
||||||
lazy_static! {
|
lazy_static! {
|
||||||
|
pub static ref THEME: config::Themes = config::config().theme.unwrap_or(config::Themes::System);
|
||||||
pub static ref CONFIG: RwLock<config::ConfigFile> = RwLock::new(config::ConfigFile::load());
|
pub static ref CONFIG: RwLock<config::ConfigFile> = RwLock::new(config::ConfigFile::load());
|
||||||
pub static ref FONT_QUOTE: Font<'static> = {
|
pub static ref FONT_QUOTE: Font<'static> = {
|
||||||
let mut buffer = Vec::new();
|
let mut buffer = Vec::new();
|
||||||
|
|
@ -28,5 +29,12 @@ lazy_static! {
|
||||||
}
|
}
|
||||||
rusttype::Font::try_from_vec(include_bytes!("../Kalam-Regular.ttf").to_vec()).unwrap()
|
rusttype::Font::try_from_vec(include_bytes!("../Kalam-Regular.ttf").to_vec()).unwrap()
|
||||||
};
|
};
|
||||||
pub static ref ICON: &'static str = include_str!("../icon.svg");
|
pub static ref ICON: OsString = include_str!("../icon.svg").into();
|
||||||
|
pub static ref RELOAD_ICON: OsString = {
|
||||||
|
let img = include_str!("../reload.svg");
|
||||||
|
if let config::Themes::Dark = *THEME {
|
||||||
|
return img.replace("fill=\"black\"", "fill=\"white\"").into();
|
||||||
|
}
|
||||||
|
img.into()
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,13 +26,7 @@ pub(crate) enum AppMessage {
|
||||||
fn main() {
|
fn main() {
|
||||||
let app = App::default();
|
let app = App::default();
|
||||||
|
|
||||||
WidgetTheme::new(
|
WidgetTheme::new(globals::THEME.clone().into()).apply();
|
||||||
config::config()
|
|
||||||
.theme
|
|
||||||
.unwrap_or(config::Themes::System)
|
|
||||||
.into(),
|
|
||||||
)
|
|
||||||
.apply();
|
|
||||||
|
|
||||||
let draw_buff: Arc<RwLock<Vec<u8>>> = Arc::new(RwLock::new(vec![]));
|
let draw_buff: Arc<RwLock<Vec<u8>>> = Arc::new(RwLock::new(vec![]));
|
||||||
let (main_sender, main_receiver) = channel::<AppMessage>();
|
let (main_sender, main_receiver) = channel::<AppMessage>();
|
||||||
|
|
|
||||||
|
|
@ -65,9 +65,11 @@ impl MainWindow {
|
||||||
draw_buff: Arc<RwLock<Vec<u8>>>,
|
draw_buff: Arc<RwLock<Vec<u8>>>,
|
||||||
) -> Self {
|
) -> Self {
|
||||||
let mut win = Window::new(0, 0, 1000, 600, "Post Maker").center_screen();
|
let mut win = Window::new(0, 0, 1000, 600, "Post Maker").center_screen();
|
||||||
if let Ok(image) = SvgImage::from_data(&globals::ICON) {
|
win.set_icon(Some(
|
||||||
win.set_icon(Some(image));
|
SvgImage::from_data(globals::ICON.to_str().unwrap()).unwrap(),
|
||||||
}
|
));
|
||||||
|
|
||||||
|
let reload_image = SvgImage::from_data(globals::RELOAD_ICON.to_str().unwrap()).unwrap();
|
||||||
|
|
||||||
let mut main_flex = Flex::default().size_of_parent().column();
|
let mut main_flex = Flex::default().size_of_parent().column();
|
||||||
let menubar = menu::SysMenuBar::default();
|
let menubar = menu::SysMenuBar::default();
|
||||||
|
|
@ -81,7 +83,8 @@ impl MainWindow {
|
||||||
let save_btn = Button::default().with_label("Save");
|
let save_btn = Button::default().with_label("Save");
|
||||||
toolbar_flex.set_size(&save_btn, 50);
|
toolbar_flex.set_size(&save_btn, 50);
|
||||||
let file_choice = menu::Choice::default();
|
let file_choice = menu::Choice::default();
|
||||||
let reset_file_choice = Button::default().with_label("@returnarrow");
|
let mut reset_file_choice = Button::default();
|
||||||
|
reset_file_choice.set_image(Some(reload_image.clone()));
|
||||||
toolbar_flex.set_size(&reset_file_choice, 30);
|
toolbar_flex.set_size(&reset_file_choice, 30);
|
||||||
toolbar_flex.end();
|
toolbar_flex.end();
|
||||||
main_flex.set_size(&toolbar_flex, 30);
|
main_flex.set_size(&toolbar_flex, 30);
|
||||||
|
|
@ -110,7 +113,8 @@ impl MainWindow {
|
||||||
Frame::default()
|
Frame::default()
|
||||||
.with_label("Dark Layer (RGBA):")
|
.with_label("Dark Layer (RGBA):")
|
||||||
.with_align(enums::Align::Left | enums::Align::Inside);
|
.with_align(enums::Align::Left | enums::Align::Inside);
|
||||||
let reset_darklayer_btn = Button::default().with_label("@returnarrow");
|
let mut reset_darklayer_btn = Button::default();
|
||||||
|
reset_darklayer_btn.set_image(Some(reload_image.clone()));
|
||||||
darklayer_head_flex.set_size(&reset_darklayer_btn, 30);
|
darklayer_head_flex.set_size(&reset_darklayer_btn, 30);
|
||||||
darklayer_head_flex.end();
|
darklayer_head_flex.end();
|
||||||
controls_flex.set_size(&darklayer_head_flex, 30);
|
controls_flex.set_size(&darklayer_head_flex, 30);
|
||||||
|
|
@ -141,13 +145,15 @@ impl MainWindow {
|
||||||
.with_label("Quote Position:")
|
.with_label("Quote Position:")
|
||||||
.with_align(enums::Align::Left | enums::Align::Inside);
|
.with_align(enums::Align::Left | enums::Align::Inside);
|
||||||
let quote_position = fltk::misc::Spinner::default();
|
let quote_position = fltk::misc::Spinner::default();
|
||||||
let reset_quote_position_btn = Button::default().with_label("@returnarrow");
|
let mut reset_quote_position_btn = Button::default();
|
||||||
|
reset_quote_position_btn.set_image(Some(reload_image.clone()));
|
||||||
quote_position_flex.set_size(&reset_quote_position_btn, 30);
|
quote_position_flex.set_size(&reset_quote_position_btn, 30);
|
||||||
quote_position_flex.end();
|
quote_position_flex.end();
|
||||||
controls_flex.set_size("e_position_flex, 30);
|
controls_flex.set_size("e_position_flex, 30);
|
||||||
|
|
||||||
let mut quote_position_slider = Slider::default().with_type(SliderType::HorizontalNice);
|
let mut quote_position_slider = Slider::default().with_type(SliderType::HorizontalNice);
|
||||||
quote_position_slider.set_step(1.0, 1);
|
quote_position_slider.set_step(1.0, 1);
|
||||||
|
quote_position_slider.set_frame(enums::FrameType::NoBox);
|
||||||
controls_flex.set_size("e_position_slider, 30);
|
controls_flex.set_size("e_position_slider, 30);
|
||||||
|
|
||||||
let mut tag_position_flex = Flex::default().row();
|
let mut tag_position_flex = Flex::default().row();
|
||||||
|
|
@ -155,13 +161,15 @@ impl MainWindow {
|
||||||
.with_label("Tag Position:")
|
.with_label("Tag Position:")
|
||||||
.with_align(enums::Align::Left | enums::Align::Inside);
|
.with_align(enums::Align::Left | enums::Align::Inside);
|
||||||
let tag_position = fltk::misc::Spinner::default();
|
let tag_position = fltk::misc::Spinner::default();
|
||||||
let reset_tag_position_btn = Button::default().with_label("@returnarrow");
|
let mut reset_tag_position_btn = Button::default();
|
||||||
|
reset_tag_position_btn.set_image(Some(reload_image.clone()));
|
||||||
tag_position_flex.set_size(&reset_tag_position_btn, 30);
|
tag_position_flex.set_size(&reset_tag_position_btn, 30);
|
||||||
tag_position_flex.end();
|
tag_position_flex.end();
|
||||||
controls_flex.set_size(&tag_position_flex, 30);
|
controls_flex.set_size(&tag_position_flex, 30);
|
||||||
|
|
||||||
let mut tag_position_slider = Slider::default().with_type(SliderType::HorizontalNice);
|
let mut tag_position_slider = Slider::default().with_type(SliderType::HorizontalNice);
|
||||||
tag_position_slider.set_step(1.0, 1);
|
tag_position_slider.set_step(1.0, 1);
|
||||||
|
tag_position_slider.set_frame(enums::FrameType::NoBox);
|
||||||
controls_flex.set_size(&tag_position_slider, 30);
|
controls_flex.set_size(&tag_position_slider, 30);
|
||||||
|
|
||||||
let mut actions_flex = Flex::default().row();
|
let mut actions_flex = Flex::default().row();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue