define margin in components

This commit is contained in:
yggverse 2024-12-15 17:56:29 +02:00
parent ab51b23f7c
commit f0e36e711d
4 changed files with 6 additions and 6 deletions

View File

@ -13,8 +13,6 @@ use gtk::{
}; };
use std::rc::Rc; use std::rc::Rc;
const MARGIN: i32 = 6;
pub struct Find { pub struct Find {
pub close: Button, pub close: Button,
pub entry: Entry, pub entry: Entry,

View File

@ -1,6 +1,7 @@
use super::MARGIN;
use gtk::{gdk::Cursor, Button}; use gtk::{gdk::Cursor, Button};
const MARGIN: i32 = 6;
pub fn new() -> Button { pub fn new() -> Button {
Button::builder() Button::builder()
.cursor(&Cursor::from_name("default", None).unwrap()) .cursor(&Cursor::from_name("default", None).unwrap())

View File

@ -1,9 +1,10 @@
use super::MARGIN;
use gtk::{ use gtk::{
prelude::{EditableExt, EntryExt}, prelude::{EditableExt, EntryExt},
Entry, EntryIconPosition, Entry, EntryIconPosition,
}; };
const MARGIN: i32 = 6;
pub fn new() -> Entry { pub fn new() -> Entry {
// Init widget // Init widget
let entry = Entry::builder() let entry = Entry::builder()

View File

@ -1,10 +1,10 @@
mod back; mod back;
mod forward; mod forward;
use gtk::{prelude::BoxExt, Box, Button, Orientation, TextIter};
use std::{cell::Cell, rc::Rc}; use std::{cell::Cell, rc::Rc};
use super::MARGIN; const MARGIN: i32 = 6;
use gtk::{prelude::BoxExt, Box, Button, Orientation, TextIter};
pub struct Navigation { pub struct Navigation {
pub back: Button, pub back: Button,