mirror of
				https://github.com/Xetibo/ReSet.git
				synced 2025-10-25 14:35:20 +02:00 
			
		
		
		
	feat: Center all widgets
This commit is contained in:
		
							parent
							
								
									905c9bbee1
								
							
						
					
					
						commit
						1868e26a2f
					
				
					 5 changed files with 17 additions and 4 deletions
				
			
		|  | @ -11,6 +11,7 @@ pub const HANDLE_CONNECTIVITY_CLICK: fn(FlowBox) =  |resetMain: FlowBox|   { | |||
|     resetMain.insert(&wifiBox, -1); | ||||
|     resetMain.insert(&bluetoothBox, -1); | ||||
|     // todo center flowbox children
 | ||||
|     resetMain.set_max_children_per_line(2); | ||||
| }; | ||||
| 
 | ||||
| pub const HANDLE_WIFI_CLICK: fn(FlowBox) =  |resetMain: FlowBox|   { | ||||
|  | @ -19,36 +20,42 @@ pub const HANDLE_WIFI_CLICK: fn(FlowBox) =  |resetMain: FlowBox|   { | |||
|     let child = FlowBoxChild::new(); | ||||
|     child.set_child(Some(&wifibox)); | ||||
|     resetMain.insert(&child, -1); | ||||
|     resetMain.set_max_children_per_line(1); | ||||
| }; | ||||
| 
 | ||||
| pub const HANDLE_BLUETOOTH_CLICK: fn(FlowBox) =  |resetMain: FlowBox|   { | ||||
|     let bluetoothBox = BluetoothBox::new(); | ||||
|     resetMain.remove_all(); | ||||
|     resetMain.insert(&bluetoothBox, -1); | ||||
|     resetMain.set_max_children_per_line(1); | ||||
| }; | ||||
| 
 | ||||
| pub const HANDLE_VPN_CLICK: fn(FlowBox) =  |resetMain: FlowBox|   { | ||||
|     let label = Label::new(Some("not implemented yet")); | ||||
|     resetMain.remove_all(); | ||||
|     resetMain.insert(&label, -1); | ||||
|     resetMain.set_max_children_per_line(1); | ||||
| }; | ||||
| 
 | ||||
| pub const HANDLE_AUDIO_CLICK: fn(FlowBox) =  |resetMain: FlowBox|   { | ||||
|     let audioBox = AudioBox::new(); | ||||
|     resetMain.remove_all(); | ||||
|     resetMain.insert(&audioBox, -1); | ||||
|     resetMain.set_max_children_per_line(1); | ||||
| }; | ||||
| 
 | ||||
| pub const HANDLE_VOLUME_CLICK: fn(FlowBox) =  |resetMain: FlowBox|   { | ||||
|     let audioBox = AudioBox::new(); | ||||
|     resetMain.remove_all(); | ||||
|     resetMain.insert(&audioBox, -1); | ||||
|     resetMain.set_max_children_per_line(1); | ||||
| }; | ||||
| 
 | ||||
| pub const HANDLE_MICROPHONE_CLICK: fn(FlowBox) =  |resetMain: FlowBox|   { | ||||
|     let label = Label::new(Some("not implemented yet")); | ||||
|     resetMain.remove_all(); | ||||
|     resetMain.insert(&label, -1); | ||||
|     resetMain.set_max_children_per_line(1); | ||||
| }; | ||||
| 
 | ||||
| pub const HANDLE_HOME: fn(FlowBox) =  |resetMain: FlowBox|   { | ||||
|  | @ -59,22 +66,26 @@ pub const HANDLE_PERIPHERALS_CLICK: fn(FlowBox) =  |resetMain: FlowBox|   { | |||
|     let label = Label::new(Some("not implemented yet")); | ||||
|     resetMain.remove_all(); | ||||
|     resetMain.insert(&label, -1); | ||||
|     resetMain.set_max_children_per_line(1); | ||||
| }; | ||||
| 
 | ||||
| pub const HANDLE_MONITOR_CLICK: fn(FlowBox) =  |resetMain: FlowBox|   { | ||||
|     let label = Label::new(Some("not implemented yet")); | ||||
|     resetMain.remove_all(); | ||||
|     resetMain.insert(&label, -1); | ||||
|     resetMain.set_max_children_per_line(1); | ||||
| }; | ||||
| 
 | ||||
| pub const HANDLE_MOUSE_CLICK: fn(FlowBox) =  |resetMain: FlowBox|   { | ||||
|     let label = Label::new(Some("not implemented yet")); | ||||
|     resetMain.remove_all(); | ||||
|     resetMain.insert(&label, -1); | ||||
|     resetMain.set_max_children_per_line(1); | ||||
| }; | ||||
| 
 | ||||
| pub const HANDLE_KEYBOARD_CLICK: fn(FlowBox) =  |resetMain: FlowBox|   { | ||||
|     let label = Label::new(Some("not implemented yet")); | ||||
|     resetMain.remove_all(); | ||||
|     resetMain.insert(&label, -1); | ||||
|     resetMain.set_max_children_per_line(1); | ||||
| }; | ||||
|  | @ -3,7 +3,7 @@ | |||
| <interface> | ||||
|     <requires lib="gtk" version="4.6"/> | ||||
|     <template class="resetAudio" parent="GtkBox"> | ||||
|         <property name="halign">start</property> | ||||
|         <property name="halign">center</property> | ||||
|         <property name="margin-start">5</property> | ||||
|         <property name="orientation">vertical</property> | ||||
|         <property name="valign">start</property> | ||||
|  |  | |||
|  | @ -3,7 +3,7 @@ | |||
| <interface> | ||||
|     <requires lib="gtk" version="4.12"/> | ||||
|     <template class="resetBluetooth" parent="GtkBox"> | ||||
|         <property name="halign">start</property> | ||||
|         <property name="halign">center</property> | ||||
|         <property name="orientation">vertical</property> | ||||
|         <property name="valign">start</property> | ||||
|         <property name="width-request">400</property> | ||||
|  |  | |||
|  | @ -141,6 +141,8 @@ | |||
|                         <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> | ||||
|  |  | |||
|  | @ -4,7 +4,7 @@ | |||
|   <requires lib="gtk" version="4.12"/> | ||||
|   <requires lib="libadwaita" version="1.4"/> | ||||
|   <template class="resetWifi" parent="GtkBox"> | ||||
|     <property name="halign">start</property> | ||||
|     <property name="halign">center</property> | ||||
|     <property name="orientation">vertical</property> | ||||
|     <property name="valign">start</property> | ||||
|     <property name="width-request">400</property> | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue