mirror of
https://github.com/Cyrix126/gupaxx.git
synced 2024-12-22 14:49:21 +00:00
fix: good width and spacing for sliders in gupaxx tab
Some checks failed
Lockbud / lockbud (push) Waiting to run
Rust / fmt (push) Waiting to run
Rust / test (push) Waiting to run
Rust / clippy (macos-latest) (push) Waiting to run
Rust / clippy (ubuntu-latest) (push) Waiting to run
Rust / check (macos-latest) (push) Waiting to run
Rust / check (ubuntu-latest) (push) Waiting to run
Rust / doc (push) Waiting to run
Typo / typo (push) Waiting to run
Audit / audit (push) Has been cancelled
Some checks failed
Lockbud / lockbud (push) Waiting to run
Rust / fmt (push) Waiting to run
Rust / test (push) Waiting to run
Rust / clippy (macos-latest) (push) Waiting to run
Rust / clippy (ubuntu-latest) (push) Waiting to run
Rust / check (macos-latest) (push) Waiting to run
Rust / check (ubuntu-latest) (push) Waiting to run
Rust / doc (push) Waiting to run
Typo / typo (push) Waiting to run
Audit / audit (push) Has been cancelled
This commit is contained in:
parent
f5b765c55f
commit
16281c8479
1 changed files with 39 additions and 26 deletions
|
@ -6,6 +6,7 @@ use crate::components::update::Update;
|
||||||
use crate::components::update::check_binary_path;
|
use crate::components::update::check_binary_path;
|
||||||
use crate::disk::state::*;
|
use crate::disk::state::*;
|
||||||
use crate::miscs::height_txt_before_button;
|
use crate::miscs::height_txt_before_button;
|
||||||
|
use common::state_edit_field::slider_state_field;
|
||||||
use log::debug;
|
use log::debug;
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
@ -205,6 +206,7 @@ impl Gupax {
|
||||||
ui.horizontal(|ui| {
|
ui.horizontal(|ui| {
|
||||||
ScrollArea::horizontal().show(ui, |ui| {
|
ScrollArea::horizontal().show(ui, |ui| {
|
||||||
ui.vertical(|ui| {
|
ui.vertical(|ui| {
|
||||||
|
ui.set_max_width(ui.available_width() / 2.0);
|
||||||
match self.ratio {
|
match self.ratio {
|
||||||
Ratio::None => (),
|
Ratio::None => (),
|
||||||
Ratio::Width => {
|
Ratio::Width => {
|
||||||
|
@ -220,34 +222,45 @@ impl Gupax {
|
||||||
}
|
}
|
||||||
// let height = height / 3.5;
|
// let height = height / 3.5;
|
||||||
// let size = vec2(width, height);
|
// let size = vec2(width, height);
|
||||||
ui.horizontal(|ui| {
|
ui.add_enabled_ui(self.ratio != Ratio::Height, |ui| {
|
||||||
ui.add_enabled_ui(self.ratio != Ratio::Height, |ui| {
|
let description = format!(
|
||||||
ui.label(format!(
|
" Width [{}-{}]:",
|
||||||
" Width [{}-{}]:",
|
APP_MIN_WIDTH as u16, APP_MAX_WIDTH as u16
|
||||||
APP_MIN_WIDTH as u16, APP_MAX_WIDTH as u16
|
);
|
||||||
));
|
slider_state_field(
|
||||||
ui.add(Slider::new(
|
ui,
|
||||||
&mut self.selected_width,
|
&description,
|
||||||
APP_MIN_WIDTH as u16..=APP_MAX_WIDTH as u16,
|
GUPAX_WIDTH,
|
||||||
))
|
&mut self.selected_width,
|
||||||
.on_hover_text(GUPAX_WIDTH);
|
APP_MIN_WIDTH as u16..=APP_MAX_WIDTH as u16,
|
||||||
});
|
);
|
||||||
|
});
|
||||||
|
ui.add_enabled_ui(self.ratio != Ratio::Width, |ui| {
|
||||||
|
let description = format!(
|
||||||
|
" Height [{}-{}]:",
|
||||||
|
APP_MIN_HEIGHT as u16, APP_MAX_HEIGHT as u16
|
||||||
|
);
|
||||||
|
slider_state_field(
|
||||||
|
ui,
|
||||||
|
&description,
|
||||||
|
GUPAX_HEIGHT,
|
||||||
|
&mut self.selected_height,
|
||||||
|
APP_MIN_HEIGHT as u16..=APP_MAX_HEIGHT as u16,
|
||||||
|
);
|
||||||
});
|
});
|
||||||
ui.horizontal(|ui| {
|
ui.horizontal(|ui| {
|
||||||
ui.add_enabled_ui(self.ratio != Ratio::Width, |ui| {
|
let description =
|
||||||
ui.label(format!(
|
format!(" Scaling [{APP_MIN_SCALE}..{APP_MAX_SCALE}]:");
|
||||||
" Height [{}-{}]:",
|
ui.add_sized(
|
||||||
APP_MIN_HEIGHT as u16, APP_MAX_HEIGHT as u16
|
[0.0, height_txt_before_button(ui, &TextStyle::Body)],
|
||||||
));
|
Label::new(description),
|
||||||
ui.add(Slider::new(
|
);
|
||||||
&mut self.selected_height,
|
ui.style_mut().spacing.slider_width = (ui.available_width()
|
||||||
APP_MIN_HEIGHT as u16..=APP_MAX_HEIGHT as u16,
|
- ui.spacing().item_spacing.x * 4.0
|
||||||
))
|
- ui.spacing().scroll.bar_width
|
||||||
.on_hover_text(GUPAX_HEIGHT);
|
- SPACE * 1.0
|
||||||
});
|
+ 2.0)
|
||||||
});
|
.max(80.0);
|
||||||
ui.horizontal(|ui| {
|
|
||||||
ui.label(format!(" Scaling [{APP_MIN_SCALE}..{APP_MAX_SCALE}]:"));
|
|
||||||
ui.add(
|
ui.add(
|
||||||
Slider::new(
|
Slider::new(
|
||||||
&mut self.selected_scale,
|
&mut self.selected_scale,
|
||||||
|
|
Loading…
Reference in a new issue