Export cambalache to ui
This commit is contained in:
takotori 2023-11-07 15:42:32 +01:00
parent af7776d62a
commit 60760d779f
12 changed files with 379 additions and 261 deletions

View file

@ -1,4 +1,3 @@
use adw::NavigationView;
use gtk::{CompositeTemplate, glib};
use gtk::prelude::*;
use gtk::subclass::prelude::*;
@ -6,7 +5,7 @@ use crate::components::temp::settingBox;
#[allow(non_snake_case)]
#[derive(Default, CompositeTemplate)]
#[template(resource = "/org/Xetibo/ReSet/resetSetting.ui")]
#[template(resource = "/org/Xetibo/ReSet/resetSettingBox.ui")]
pub struct SettingBox {}
#[glib::object_subclass]

View file

@ -8,8 +8,6 @@ use crate::components::wifi::wifiBox::WifiBox;
pub const HANDLE_CONNECTIVITY_CLICK: fn(FlowBox) = |resetMain: FlowBox| {
let wifiBox = SettingBox::new(&WifiBox::new());
let bluetoothBox = SettingBox::new(&BluetoothBox::new());
wifiBox.set_width_request(500); // todo why not working from ui file
bluetoothBox.set_width_request(500); // todo why not working from ui file
resetMain.remove_all();
resetMain.insert(&wifiBox, -1);
resetMain.insert(&bluetoothBox, -1);
@ -18,7 +16,6 @@ pub const HANDLE_CONNECTIVITY_CLICK: fn(FlowBox) = |resetMain: FlowBox| {
pub const HANDLE_WIFI_CLICK: fn(FlowBox) = |resetMain: FlowBox| {
let wifiBox = SettingBox::new(&WifiBox::new());
wifiBox.set_width_request(500); // todo why not working from ui file
resetMain.remove_all();
resetMain.insert(&wifiBox, -1);
resetMain.set_max_children_per_line(1);
@ -26,7 +23,6 @@ pub const HANDLE_WIFI_CLICK: fn(FlowBox) = |resetMain: FlowBox| {
pub const HANDLE_BLUETOOTH_CLICK: fn(FlowBox) = |resetMain: FlowBox| {
let bluetoothBox = SettingBox::new(&BluetoothBox::new());
bluetoothBox.set_width_request(500); // todo why not working from ui file
resetMain.remove_all();
resetMain.insert(&bluetoothBox, -1);
resetMain.set_max_children_per_line(1);

View file

@ -3,8 +3,6 @@
<interface>
<requires lib="gtk" version="4.12"/>
<template class="resetBluetooth" parent="GtkBox">
<property name="hexpand">True</property>
<property name="hexpand-set">True</property>
<property name="orientation">vertical</property>
<property name="valign">start</property>
<child>
@ -60,7 +58,7 @@
<child>
<object class="GtkListBox" id="resetBluetoothAvailableDevices">
<property name="css-classes">boxed-list
</property>
</property>
<property name="margin-end">5</property>
<property name="margin-start">5</property>
<property name="show-separators">True</property>
@ -94,7 +92,7 @@
<child>
<object class="GtkListBox" id="resetBluetoothConnectedDevices">
<property name="css-classes">boxed-list
</property>
</property>
<property name="margin-end">5</property>
<property name="margin-start">5</property>
<property name="show-separators">True</property>

View file

@ -135,14 +135,14 @@
<child>
<object class="GtkFlowBox" id="resetMain">
<property name="column-spacing">25</property>
<property name="halign">center</property>
<property name="hexpand">True</property>
<property name="hexpand-set">True</property>
<property name="homogeneous">True</property>
<property name="margin-top">5</property>
<property name="row-spacing">25</property>
<property name="selection-mode">none</property>
<property name="valign">start</property>
<property name="halign">center</property>
<property name="homogeneous">True</property>
</object>
</child>
</object>

View file

@ -0,0 +1,62 @@
<?xml version='1.0' encoding='UTF-8'?>
<!-- Created with Cambalache 0.17.0 -->
<interface>
<requires lib="gtk" version="4.12"/>
<template class="resetMicEntry" parent="GtkBox">
<property name="margin-end">5</property>
<property name="margin-start">5</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkBox">
<property name="margin-bottom">5</property>
<child>
<object class="GtkImage" id="resetMicIcon">
<property name="icon-name">audio-input-microphone-symbolic</property>
<property name="margin-end">5</property>
</object>
</child>
<child>
<object class="GtkLabel" id="resetMicName">
<property name="label">Input Volume</property>
</object>
</child>
</object>
</child>
<child>
<object class="GtkBox">
<property name="margin-bottom">5</property>
<property name="margin-top">5</property>
<child>
<object class="GtkButton" id="resetMicMute">
<property name="icon-name">audio-input-microphone-symbolic</property>
<property name="margin-end">5</property>
<property name="valign">center</property>
</object>
</child>
<child>
<object class="GtkScale" id="resetMicSlider">
<property name="adjustment">
<object class="GtkAdjustment">
<property name="page-increment">5.0</property>
<property name="upper">100.0</property>
</object>
</property>
<property name="hexpand">True</property>
<property name="valign">center</property>
<property name="value-pos">bottom</property>
</object>
</child>
<child>
<object class="GtkLabel" id="resetMicPercentage">
<property name="label">100%</property>
<property name="lines">1</property>
<property name="width-request">40</property>
</object>
</child>
</object>
</child>
<child>
<object class="GtkProgressBar" id="resetMicMeter"/>
</child>
</template>
</interface>

View file

@ -0,0 +1,61 @@
<?xml version='1.0' encoding='UTF-8'?>
<!-- Created with Cambalache 0.17.0 -->
<interface>
<requires lib="gtk" version="4.6"/>
<template class="resetMicrophone" parent="GtkBox">
<property name="halign">start</property>
<property name="margin-start">5</property>
<property name="orientation">vertical</property>
<property name="valign">start</property>
<property name="width-request">400</property>
<child>
<object class="GtkBox">
<property name="height-request">40</property>
<child>
<object class="GtkLabel">
<property name="label">Input Device</property>
</object>
</child>
<child>
<object class="GtkDropDown" id="resetOutputDevice">
<property name="halign">end</property>
<property name="hexpand">True</property>
<property name="valign">center</property>
</object>
</child>
</object>
</child>
<child>
<object class="GtkBox">
<property name="height-request">40</property>
<property name="margin-bottom">5</property>
<child>
<object class="GtkLabel">
<property name="label">Show Applications</property>
</object>
</child>
<child>
<object class="GtkSwitch">
<property name="active">True</property>
<property name="halign">end</property>
<property name="hexpand">True</property>
<property name="margin-end">5</property>
<property name="valign">center</property>
</object>
</child>
</object>
</child>
<child>
<object class="GtkSeparator"/>
</child>
<child>
<object class="GtkViewport">
<child>
<object class="resetMicEntry">
<property name="margin-top">5</property>
</object>
</child>
</object>
</child>
</template>
</interface>

View file

@ -3,7 +3,7 @@
<interface>
<requires lib="gtk" version="4.0"/>
<template class="resetSidebarEntry" parent="GtkListBoxRow">
<child>
<property name="child">
<object class="GtkBox">
<property name="margin-bottom">10</property>
<property name="margin-start">10</property>
@ -17,6 +17,6 @@
<object class="GtkLabel" id="resetSidebarLabel"/>
</child>
</object>
</child>
</property>
</template>
</interface>

View file

@ -202,8 +202,10 @@
(3,42,"GtkWidget","width-request","150",None,None,None,None,None,None,None,None,None),
(3,43,"GtkScrolledWindow","propagate-natural-height","True",None,None,None,None,None,None,None,None,None),
(3,45,"GtkFlowBox","column-spacing","25",None,None,None,None,None,None,None,None,None),
(3,45,"GtkFlowBox","homogeneous","True",None,None,None,None,None,None,None,None,None),
(3,45,"GtkFlowBox","row-spacing","25",None,None,None,None,None,None,None,None,None),
(3,45,"GtkFlowBox","selection-mode","none",None,None,None,None,None,None,None,None,None),
(3,45,"GtkWidget","halign","center",None,None,None,None,None,None,None,None,None),
(3,45,"GtkWidget","hexpand","True",None,None,None,None,None,None,None,None,None),
(3,45,"GtkWidget","hexpand-set","True",None,None,None,None,None,None,None,None,None),
(3,45,"GtkWidget","margin-top","5",None,None,None,None,None,None,None,None,None),
@ -325,7 +327,7 @@
(7,12,"GtkLabel","lines","1",None,None,None,None,None,None,None,None,None),
(7,12,"GtkWidget","width-request","40",None,None,None,None,None,None,None,None,None),
(8,1,"GtkOrientable","orientation","vertical",None,None,None,None,None,None,None,None,None),
(8,1,"GtkWidget","halign","start",None,None,None,None,None,None,None,None,None),
(8,1,"GtkWidget","halign","center",None,None,None,None,None,None,None,None,None),
(8,1,"GtkWidget","margin-start","5",None,None,None,None,None,None,None,None,None),
(8,1,"GtkWidget","valign","start",None,None,None,None,None,None,None,None,None),
(8,1,"GtkWidget","width-request","400",None,None,None,None,None,None,None,None,None),