mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-03-31 16:45:27 +00:00
fix vertical alignment
This commit is contained in:
parent
74322fb850
commit
79941f9592
5 changed files with 18 additions and 16 deletions
|
|
@ -10,7 +10,7 @@ use tag::Tag;
|
|||
|
||||
use gtk::{
|
||||
prelude::{BoxExt, ButtonExt, CheckButtonExt, EditableExt, TextBufferExt},
|
||||
Box, Button, Orientation, TextBuffer, TextIter, TextSearchFlags, TextTag,
|
||||
Align, Box, Button, Orientation, TextBuffer, TextIter, TextSearchFlags, TextTag,
|
||||
};
|
||||
use std::rc::Rc;
|
||||
|
||||
|
|
@ -35,6 +35,8 @@ impl Search {
|
|||
let g_box = Box::builder()
|
||||
.css_classes(["osd"])
|
||||
.orientation(Orientation::Horizontal)
|
||||
.valign(Align::Center)
|
||||
.vexpand(false)
|
||||
.visible(false)
|
||||
.build();
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
use gtk::{gdk::Cursor, Button};
|
||||
use gtk::{gdk::Cursor, Align, Button};
|
||||
|
||||
const MARGIN: i32 = 6;
|
||||
|
||||
|
|
@ -6,10 +6,10 @@ pub fn new() -> Button {
|
|||
Button::builder()
|
||||
.cursor(&Cursor::from_name("default", None).unwrap())
|
||||
.icon_name("window-close-symbolic")
|
||||
.margin_bottom(MARGIN)
|
||||
.margin_end(MARGIN)
|
||||
.margin_start(MARGIN)
|
||||
.margin_top(MARGIN)
|
||||
.valign(Align::Center)
|
||||
.vexpand(false)
|
||||
.tooltip_text("Close find bar")
|
||||
.build()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use gtk::{
|
||||
prelude::{EditableExt, EntryExt, WidgetExt},
|
||||
Entry, EntryIconPosition,
|
||||
Align, Entry, EntryIconPosition,
|
||||
};
|
||||
|
||||
const MARGIN: i32 = 6;
|
||||
|
|
@ -17,12 +17,16 @@ impl Input {
|
|||
// Init widget
|
||||
let entry = Entry::builder()
|
||||
.hexpand(true)
|
||||
.margin_bottom(MARGIN)
|
||||
.margin_end(MARGIN)
|
||||
.margin_start(MARGIN)
|
||||
.margin_top(MARGIN)
|
||||
.placeholder_text("Find in text..")
|
||||
.primary_icon_activatable(false)
|
||||
.primary_icon_sensitive(false)
|
||||
.primary_icon_name("system-search-symbolic")
|
||||
.primary_icon_sensitive(false)
|
||||
.valign(Align::Center)
|
||||
.vexpand(false)
|
||||
.build();
|
||||
|
||||
// Connect events
|
||||
|
|
|
|||
|
|
@ -1,6 +1,4 @@
|
|||
use gtk::{gdk::Cursor, prelude::WidgetExt, Button};
|
||||
|
||||
const MARGIN: i32 = 6;
|
||||
use gtk::{gdk::Cursor, prelude::WidgetExt, Align, Button};
|
||||
|
||||
pub struct Back {
|
||||
pub button: Button,
|
||||
|
|
@ -15,10 +13,10 @@ impl Back {
|
|||
button: Button::builder()
|
||||
.cursor(&Cursor::from_name("default", None).unwrap())
|
||||
.icon_name("go-up-symbolic")
|
||||
.margin_bottom(MARGIN)
|
||||
.margin_top(MARGIN)
|
||||
.sensitive(false)
|
||||
.tooltip_text("Back")
|
||||
.valign(Align::Center)
|
||||
.vexpand(false)
|
||||
.build(),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,4 @@
|
|||
use gtk::{gdk::Cursor, prelude::WidgetExt, Button};
|
||||
|
||||
const MARGIN: i32 = 6;
|
||||
use gtk::{gdk::Cursor, prelude::WidgetExt, Align, Button};
|
||||
|
||||
pub struct Forward {
|
||||
pub button: Button,
|
||||
|
|
@ -15,10 +13,10 @@ impl Forward {
|
|||
button: Button::builder()
|
||||
.cursor(&Cursor::from_name("default", None).unwrap())
|
||||
.icon_name("go-down-symbolic")
|
||||
.margin_bottom(MARGIN)
|
||||
.margin_top(MARGIN)
|
||||
.sensitive(false)
|
||||
.tooltip_text("Forward")
|
||||
.valign(Align::Center)
|
||||
.vexpand(false)
|
||||
.build(),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue