Sliding details
This commit is contained in:
parent
f5e2be9651
commit
bd637cb97d
@ -2,53 +2,77 @@ using Gtk 4.0;
|
|||||||
using Adw 1;
|
using Adw 1;
|
||||||
|
|
||||||
Adw.ApplicationWindow window {
|
Adw.ApplicationWindow window {
|
||||||
default-width: 900;
|
default-width: 900;
|
||||||
default-height: 500;
|
default-height: 500;
|
||||||
|
|
||||||
content: Gtk.Box {
|
content: Gtk.Box {
|
||||||
orientation: vertical;
|
orientation: vertical;
|
||||||
|
|
||||||
Adw.HeaderBar{
|
Adw.HeaderBar {
|
||||||
title-widget: Adw.WindowTitle {
|
title-widget: Adw.WindowTitle {
|
||||||
title: "Sieverman";
|
title: "Sieverman";
|
||||||
};
|
};
|
||||||
|
|
||||||
Gtk.Button { label: "Neu";}
|
[start]
|
||||||
}
|
Gtk.Button {
|
||||||
Gtk.Box {
|
label: "Neu";
|
||||||
orientation: horizontal;
|
}
|
||||||
|
|
||||||
vexpand: true;
|
|
||||||
halign: fill;
|
|
||||||
|
|
||||||
Gtk.Label{
|
[end]
|
||||||
label: "Log information";
|
Gtk.ToggleButton settings_button {
|
||||||
hexpand: true;
|
icon-name: "open-menu-symbolic";
|
||||||
|
active: true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Gtk.Box {
|
||||||
|
orientation: horizontal;
|
||||||
|
vexpand: true;
|
||||||
|
halign: fill;
|
||||||
|
|
||||||
|
Gtk.Label {
|
||||||
|
label: "Log information";
|
||||||
|
hexpand: true;
|
||||||
|
}
|
||||||
|
|
||||||
|
Gtk.Revealer settings_pane {
|
||||||
|
reveal-child: bind settings_button.active bidirectional;
|
||||||
|
transition-type: slide_left;
|
||||||
|
|
||||||
|
Gtk.ScrolledWindow server_info {
|
||||||
|
width-request: 100;
|
||||||
|
|
||||||
|
Adw.PreferencesPage {
|
||||||
|
Adw.PreferencesGroup server_settings {
|
||||||
|
vexpand: true;
|
||||||
|
valign: center;
|
||||||
|
title: "Server Information";
|
||||||
|
description: "The information the server published on connection";
|
||||||
}
|
}
|
||||||
Gtk.ScrolledWindow server_info {
|
|
||||||
width-request: 100;
|
|
||||||
Adw.PreferencesPage {
|
|
||||||
Adw.PreferencesGroup server_settings{
|
|
||||||
vexpand: true;
|
|
||||||
valign: center;
|
|
||||||
title: "Server Information";
|
|
||||||
description: "The information the server published on connection";
|
|
||||||
}
|
|
||||||
Adw.PreferencesGroup credentials {
|
|
||||||
vexpand: true;
|
|
||||||
valign: center;
|
|
||||||
title: "Login Information";
|
|
||||||
description: "The credentials that will be used to log in.";
|
|
||||||
Adw.EntryRow{title: "Username:";}
|
|
||||||
Adw.PasswordEntryRow{title: "Password:";}
|
|
||||||
|
|
||||||
}}
|
Adw.PreferencesGroup credentials {
|
||||||
|
vexpand: true;
|
||||||
|
valign: center;
|
||||||
|
title: "Login Information";
|
||||||
|
description: "The credentials that will be used to log in.";
|
||||||
|
|
||||||
|
Adw.EntryRow {
|
||||||
|
title: "Username:";
|
||||||
|
}
|
||||||
|
|
||||||
|
Adw.PasswordEntryRow {
|
||||||
|
title: "Password:";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Gtk.Statusbar{Gtk.Label{
|
}
|
||||||
label: "Status";
|
}
|
||||||
}}
|
|
||||||
|
|
||||||
};
|
Gtk.Statusbar {
|
||||||
}
|
Gtk.Label {
|
||||||
|
label: "Status";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
use std::{cell::RefCell, rc::Rc};
|
use std::{cell::RefCell, rc::Rc};
|
||||||
|
|
||||||
use crate::__COMPILED_BLUEPRINT_MAP__;
|
use crate::__COMPILED_BLUEPRINT_MAP__;
|
||||||
use gtk4::{
|
use gtk::{
|
||||||
glib,
|
|
||||||
prelude::{ApplicationExt, GtkWindowExt},
|
prelude::{ApplicationExt, GtkWindowExt},
|
||||||
Application,
|
Application,
|
||||||
};
|
};
|
||||||
|
use gtk4 as gtk;
|
||||||
use gtk_blueprint::get_blp;
|
use gtk_blueprint::get_blp;
|
||||||
use libadwaita::prelude::{PreferencesGroupExt, PreferencesRowExt};
|
use libadwaita::prelude::{PreferencesGroupExt, PreferencesRowExt};
|
||||||
use tracing::trace;
|
use tracing::trace;
|
||||||
@ -25,16 +25,17 @@ pub(crate) fn get_app(
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn build_ui(
|
fn build_ui(
|
||||||
app: >k4::Application,
|
app: >k::Application,
|
||||||
from_backend_rx: Rc<RefCell<Option<tokio::sync::mpsc::Receiver<BackToFront>>>>,
|
from_backend_rx: Rc<RefCell<Option<tokio::sync::mpsc::Receiver<BackToFront>>>>,
|
||||||
) {
|
) {
|
||||||
let builder = gtk4::Builder::new();
|
let builder = gtk::Builder::new();
|
||||||
builder
|
builder
|
||||||
.add_from_string(get_blp!("gui/main_window.blp"))
|
.add_from_string(get_blp!("gui/main_window.blp"))
|
||||||
.expect("Failed to parse blueprint");
|
.expect("Failed to parse blueprint");
|
||||||
let main_window = builder
|
let main_window = builder
|
||||||
.object::<libadwaita::ApplicationWindow>("window")
|
.object::<libadwaita::ApplicationWindow>("window")
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let prefrences_group = builder
|
let prefrences_group = builder
|
||||||
.object::<libadwaita::PreferencesGroup>("server_settings")
|
.object::<libadwaita::PreferencesGroup>("server_settings")
|
||||||
.unwrap();
|
.unwrap();
|
||||||
@ -58,14 +59,14 @@ fn build_ui(
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
let c = glib::MainContext::default();
|
let c = gtk::glib::MainContext::default();
|
||||||
c.spawn_local(future);
|
c.spawn_local(future);
|
||||||
main_window.present();
|
main_window.present();
|
||||||
trace!("Window is visible");
|
trace!("Window is visible");
|
||||||
}
|
}
|
||||||
|
|
||||||
fn row_in_settings(name: &str, value: &str) -> libadwaita::ActionRow {
|
fn row_in_settings(name: &str, value: &str) -> libadwaita::ActionRow {
|
||||||
let builder = gtk4::Builder::new();
|
let builder = gtk::Builder::new();
|
||||||
builder
|
builder
|
||||||
.add_from_string(get_blp!("gui/server_info_row.blp"))
|
.add_from_string(get_blp!("gui/server_info_row.blp"))
|
||||||
.expect("Failed to parse blueprint");
|
.expect("Failed to parse blueprint");
|
||||||
@ -75,7 +76,7 @@ fn row_in_settings(name: &str, value: &str) -> libadwaita::ActionRow {
|
|||||||
.unwrap();
|
.unwrap();
|
||||||
row.set_title(name);
|
row.set_title(name);
|
||||||
let label = builder
|
let label = builder
|
||||||
.object::<gtk4::Label>("server_info_row_value")
|
.object::<gtk::Label>("server_info_row_value")
|
||||||
.unwrap();
|
.unwrap();
|
||||||
label.set_label(value);
|
label.set_label(value);
|
||||||
row
|
row
|
||||||
|
Loading…
Reference in New Issue
Block a user