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

@ -1,57 +1,57 @@
<?xml version='1.0' encoding='UTF-8'?>
<!-- Created with Cambalache 0.17.0 -->
<interface>
<requires lib="gtk" version="4.6"/>
<template class="resetAudio" parent="GtkBox">
<property name="halign">center</property>
<property name="margin-start">5</property>
<property name="orientation">vertical</property>
<property name="valign">start</property>
<property name="width-request">400</property>
<requires lib="gtk" version="4.6"/>
<template class="resetAudio" parent="GtkBox">
<property name="halign">center</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="GtkBox">
<property name="height-request">40</property>
<child>
<object class="GtkLabel">
<property name="label">Output 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>
<object class="GtkLabel">
<property name="label">Output Device</property>
</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>
<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="GtkSeparator"/>
<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>
<child>
<object class="resetAudioSourceEntry" id="asdf">
<property name="margin-top">5</property>
</object>
</child>
</template>
</object>
</child>
<child>
<object class="GtkSeparator"/>
</child>
<child>
<object class="resetAudioSourceEntry" id="asdf">
<property name="margin-top">5</property>
</object>
</child>
</template>
</interface>

View file

@ -1,62 +1,62 @@
<?xml version='1.0' encoding='UTF-8'?>
<!-- Created with Cambalache 0.17.0 -->
<interface>
<requires lib="gtk" version="4.12"/>
<template class="resetAudioSourceEntry" parent="GtkBox">
<property name="margin-end">5</property>
<property name="margin-start">5</property>
<property name="orientation">vertical</property>
<requires lib="gtk" version="4.12"/>
<template class="resetAudioSourceEntry" 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="GtkBox">
<property name="margin-bottom">5</property>
<child>
<object class="GtkImage" id="resetSourceIcon">
<property name="icon-name">audio-volume-high-symbolic</property>
<property name="margin-end">5</property>
</object>
</child>
<child>
<object class="GtkLabel" id="resetSourceName">
<property name="label">System Volume</property>
</object>
</child>
</object>
<object class="GtkImage" id="resetSourceIcon">
<property name="icon-name">audio-volume-high-symbolic</property>
<property name="margin-end">5</property>
</object>
</child>
<child>
<object class="GtkBox">
<property name="margin-bottom">5</property>
<property name="margin-top">5</property>
<child>
<object class="GtkButton" id="resetSourceMute">
<property name="icon-name">audio-volume-high-symbolic</property>
<property name="margin-end">5</property>
<property name="valign">center</property>
</object>
</child>
<child>
<object class="GtkScale" id="resetVolumeSlider">
<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="resetVolumePercentage">
<property name="label">100%</property>
<property name="lines">1</property>
<property name="width-request">40</property>
</object>
</child>
</object>
<object class="GtkLabel" id="resetSourceName">
<property name="label">System 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="resetSourceMute">
<property name="icon-name">audio-volume-high-symbolic</property>
<property name="margin-end">5</property>
<property name="valign">center</property>
</object>
</child>
<child>
<object class="GtkProgressBar" id="resetVolumeMeter"/>
<object class="GtkScale" id="resetVolumeSlider">
<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>
</template>
<child>
<object class="GtkLabel" id="resetVolumePercentage">
<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="resetVolumeMeter"/>
</child>
</template>
</interface>

View file

@ -1,119 +1,117 @@
<?xml version='1.0' encoding='UTF-8'?>
<!-- Created with Cambalache 0.17.0 -->
<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>
<requires lib="gtk" version="4.12"/>
<template class="resetBluetooth" parent="GtkBox">
<property name="orientation">vertical</property>
<property name="valign">start</property>
<child>
<object class="GtkListBox" id="resetBluetoothDetails">
<property name="css-classes">boxed-list</property>
<property name="margin-bottom">10</property>
<property name="margin-start">5</property>
<property name="show-separators">True</property>
<property name="valign">start</property>
<child>
<object class="GtkListBox" id="resetBluetoothDetails">
<property name="css-classes">boxed-list</property>
<property name="margin-bottom">10</property>
<property name="margin-start">5</property>
<property name="show-separators">True</property>
<property name="valign">start</property>
<object class="resetListBoxRow" id="resetBluetoothSwitchRow">
<child>
<object class="GtkBox">
<property name="height-request">40</property>
<child>
<object class="resetListBoxRow" id="resetBluetoothSwitchRow">
<child>
<object class="GtkBox">
<property name="height-request">40</property>
<child>
<object class="GtkLabel">
<property name="label">Bluetooth</property>
<property name="margin-start">5</property>
</object>
</child>
<child>
<object class="GtkSwitch" id="resetBluetoothSwitch">
<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>
</object>
<object class="GtkLabel">
<property name="label">Bluetooth</property>
<property name="margin-start">5</property>
</object>
</child>
</object>
<child>
<object class="GtkSwitch" id="resetBluetoothSwitch">
<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>
</object>
</child>
</object>
</child>
<child>
<object class="GtkBox">
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel">
<property name="halign">start</property>
<property name="justify">right</property>
<property name="label">Available devices</property>
<property name="margin-start">5</property>
</object>
</child>
<child>
<object class="GtkBox">
<property name="orientation">vertical</property>
<object class="GtkScrolledWindow">
<property name="min-content-height">100</property>
<property name="propagate-natural-height">True</property>
<child>
<object class="GtkViewport">
<child>
<object class="GtkLabel">
<property name="halign">start</property>
<property name="justify">right</property>
<property name="label">Available devices</property>
<property name="margin-start">5</property>
</object>
<object class="GtkListBox" id="resetBluetoothAvailableDevices">
<property name="css-classes">boxed-list
</property>
<property name="margin-end">5</property>
<property name="margin-start">5</property>
<property name="show-separators">True</property>
<property name="valign">start</property>
</object>
</child>
<child>
<object class="GtkScrolledWindow">
<property name="min-content-height">100</property>
<property name="propagate-natural-height">True</property>
<child>
<object class="GtkViewport">
<child>
<object class="GtkListBox" id="resetBluetoothAvailableDevices">
<property name="css-classes">boxed-list
</property>
<property name="margin-end">5</property>
<property name="margin-start">5</property>
<property name="show-separators">True</property>
<property name="valign">start</property>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkBox">
<property name="margin-top">10</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel">
<property name="halign">start</property>
<property name="justify">right</property>
<property name="label">Connected devices</property>
<property name="margin-start">5</property>
</object>
</child>
<child>
<object class="GtkBox">
<property name="margin-top">10</property>
<property name="orientation">vertical</property>
<object class="GtkScrolledWindow">
<property name="min-content-height">100</property>
<property name="propagate-natural-height">True</property>
<child>
<object class="GtkViewport">
<child>
<object class="GtkLabel">
<property name="halign">start</property>
<property name="justify">right</property>
<property name="label">Connected devices</property>
<property name="margin-start">5</property>
</object>
<object class="GtkListBox" id="resetBluetoothConnectedDevices">
<property name="css-classes">boxed-list
</property>
<property name="margin-end">5</property>
<property name="margin-start">5</property>
<property name="show-separators">True</property>
<property name="valign">start</property>
</object>
</child>
<child>
<object class="GtkScrolledWindow">
<property name="min-content-height">100</property>
<property name="propagate-natural-height">True</property>
<child>
<object class="GtkViewport">
<child>
<object class="GtkListBox" id="resetBluetoothConnectedDevices">
<property name="css-classes">boxed-list
</property>
<property name="margin-end">5</property>
<property name="margin-start">5</property>
<property name="show-separators">True</property>
<property name="valign">start</property>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</object>
</child>
</object>
</child>
<child>
<object class="GtkButton">
<property name="halign">start</property>
<property name="label">Advanced</property>
<property name="margin-top">5</property>
<property name="valign">start</property>
</object>
</child>
</template>
</object>
</child>
<child>
<object class="GtkButton">
<property name="halign">start</property>
<property name="label">Advanced</property>
<property name="margin-top">5</property>
<property name="valign">start</property>
</object>
</child>
</template>
</interface>

View file

@ -1,31 +1,31 @@
<?xml version='1.0' encoding='UTF-8'?>
<!-- Created with Cambalache 0.17.0 -->
<interface>
<requires lib="gtk" version="4.12"/>
<template class="resetBluetoothEntry" parent="GtkBox">
<property name="margin-start">5</property>
<child>
<object class="GtkImage" id="resetBluetoothDeviceType">
<property name="icon-name">input-mouse-symbolic</property>
<property name="margin-end">15</property>
</object>
</child>
<child>
<object class="GtkLabel" id="resetBluetoothLabel">
<property name="ellipsize">end</property>
<property name="hexpand">True</property>
<property name="label">LoremIpsum Wireless Mouse</property>
<property name="margin-end">10</property>
<property name="single-line-mode">True</property>
<property name="width-request">200</property>
<property name="xalign">0.0</property>
</object>
</child>
<child>
<object class="GtkButton" id="resetBluetoothButton">
<property name="has-frame">False</property>
<property name="icon-name">emblem-system-symbolic</property>
</object>
</child>
</template>
<requires lib="gtk" version="4.12"/>
<template class="resetBluetoothEntry" parent="GtkBox">
<property name="margin-start">5</property>
<child>
<object class="GtkImage" id="resetBluetoothDeviceType">
<property name="icon-name">input-mouse-symbolic</property>
<property name="margin-end">15</property>
</object>
</child>
<child>
<object class="GtkLabel" id="resetBluetoothLabel">
<property name="ellipsize">end</property>
<property name="hexpand">True</property>
<property name="label">LoremIpsum Wireless Mouse</property>
<property name="margin-end">10</property>
<property name="single-line-mode">True</property>
<property name="width-request">200</property>
<property name="xalign">0.0</property>
</object>
</child>
<child>
<object class="GtkButton" id="resetBluetoothButton">
<property name="has-frame">False</property>
<property name="icon-name">emblem-system-symbolic</property>
</object>
</child>
</template>
</interface>

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>
@ -196,7 +196,7 @@
<!-- Custom fragments -->
<child>
<object id="resetSidebarBreakpoint" class="AdwBreakpoint">
</object>
</object>
</child>
</template>
</interface>

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

@ -1,11 +1,11 @@
<?xml version='1.0' encoding='UTF-8'?>
<!-- Created with Cambalache 0.17.0 -->
<interface>
<requires lib="gtk" version="4.0"/>
<template class="resetSetting" parent="GtkBox">
<property name="halign">center</property>
<property name="orientation">vertical</property>
<property name="valign">start</property>
<property name="width-request">500</property>
</template>
<requires lib="gtk" version="4.0"/>
<template class="resetSetting" parent="GtkBox">
<property name="halign">center</property>
<property name="orientation">vertical</property>
<property name="valign">start</property>
<property name="width-request">500</property>
</template>
</interface>

View file

@ -1,22 +1,22 @@
<?xml version='1.0' encoding='UTF-8'?>
<!-- Created with Cambalache 0.17.0 -->
<interface>
<requires lib="gtk" version="4.0"/>
<template class="resetSidebarEntry" parent="GtkListBoxRow">
<requires lib="gtk" version="4.0"/>
<template class="resetSidebarEntry" parent="GtkListBoxRow">
<property name="child">
<object class="GtkBox">
<property name="margin-bottom">10</property>
<property name="margin-start">10</property>
<property name="margin-top">10</property>
<child>
<object class="GtkBox">
<property name="margin-bottom">10</property>
<property name="margin-start">10</property>
<property name="margin-top">10</property>
<child>
<object class="GtkImage" id="resetSidebarImage">
<property name="margin-end">10</property>
</object>
</child>
<child>
<object class="GtkLabel" id="resetSidebarLabel"/>
</child>
</object>
<object class="GtkImage" id="resetSidebarImage">
<property name="margin-end">10</property>
</object>
</child>
</template>
<child>
<object class="GtkLabel" id="resetSidebarLabel"/>
</child>
</object>
</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),