gnome-control-center/panels/bluetooth/cc-bluetooth-panel.ui
Benjamin Berg 75c3e11708 bluetooth: Fix bluetooth switch transitions
This commit changes the switch to do a proper delayed state change using
the state-set signal. Also changed is that we always update the switch
state rather than avoiding an update when it is not powered.

Avoiding this update was introduced in commit 4a009da483 (bluetooth:
Don't change the switch status when transitioning), however, the current
implementation causes us to get stuck in the wrong visual state
sometimes. Also, with this patch I am unable to see any visual glitch on
hardware that should be affected, and even if there was a glitch,
getting the final state right is more important.

Closes: #607, #1272
2021-07-29 23:10:46 +00:00

200 lines
8.5 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
<template class="CcBluetoothPanel" parent="CcPanel">
<property name="visible">True</property>
<child>
<object class="GtkStack" id="stack">
<property name="visible">True</property>
<child>
<object class="GtkBox" id="no_devices_box">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="margin_top">64</property>
<property name="margin_bottom">64</property>
<property name="margin_start">12</property>
<property name="margin_end">12</property>
<property name="spacing">24</property>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="icon_name">bluetooth-active-symbolic</property>
<property name="pixel_size">192</property>
<style>
<class name="dim-label"/>
</style>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="label" translatable="yes">No Bluetooth Found</property>
<attributes>
<attribute name="weight" value="bold"/>
<attribute name="scale" value="1.2"/>
</attributes>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="wrap">True</property>
<property name="label" translatable="yes">Plug in a dongle to use Bluetooth.</property>
</object>
</child>
</object>
</child>
<child>
<object class="GtkBox" id="disabled_box">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="margin_top">64</property>
<property name="margin_bottom">64</property>
<property name="margin_start">12</property>
<property name="margin_end">12</property>
<property name="spacing">24</property>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="icon_name">bluetooth-active-symbolic</property>
<property name="pixel_size">192</property>
<style>
<class name="dim-label"/>
</style>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="label" translatable="yes">Bluetooth Turned Off</property>
<attributes>
<attribute name="weight" value="bold"/>
<attribute name="scale" value="1.2"/>
</attributes>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="wrap">True</property>
<property name="label" translatable="yes">Turn on to connect devices and receive file transfers.</property>
</object>
</child>
</object>
</child>
<child>
<object class="GtkBox" id="airplane_box">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="margin_top">64</property>
<property name="margin_bottom">64</property>
<property name="margin_start">12</property>
<property name="margin_end">12</property>
<property name="spacing">24</property>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="icon_name">airplane-mode-symbolic</property>
<property name="pixel_size">192</property>
<style>
<class name="dim-label"/>
</style>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="label" translatable="yes">Airplane Mode is on</property>
<attributes>
<attribute name="weight" value="bold"/>
<attribute name="scale" value="1.2"/>
</attributes>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="wrap">True</property>
<property name="label" translatable="yes">Bluetooth is disabled when airplane mode is on.</property>
</object>
</child>
<child>
<object class="GtkButton">
<property name="visible">True</property>
<property name="label" translatable="yes">Turn Off Airplane Mode</property>
<property name="halign">center</property>
<property name="valign">center</property>
<signal name="clicked" handler="airplane_mode_off_button_clicked_cb" object="CcBluetoothPanel" swapped="yes"/>
</object>
</child>
</object>
</child>
<child>
<object class="GtkBox" id="hw_airplane_box">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="margin_top">64</property>
<property name="margin_bottom">64</property>
<property name="margin_start">12</property>
<property name="margin_end">12</property>
<property name="spacing">24</property>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="icon_name">airplane-mode-symbolic</property>
<property name="pixel_size">192</property>
<style>
<class name="dim-label"/>
</style>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="label" translatable="yes">Hardware Airplane Mode is on</property>
<attributes>
<attribute name="weight" value="bold"/>
<attribute name="scale" value="1.2"/>
</attributes>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="wrap">True</property>
<property name="label" translatable="yes">Turn off the Airplane mode switch to enable Bluetooth.</property>
</object>
</child>
</object>
</child>
<child>
<object class="BluetoothSettingsWidget" id="settings_widget">
<property name="visible">True</property>
<signal name="panel-changed" handler="panel_changed_cb" object="CcBluetoothPanel" swapped="yes"/>
<signal name="adapter-status-changed" handler="adapter_status_changed_cb" object="CcBluetoothPanel" swapped="yes"/>
</object>
</child>
</object>
</child>
</template>
<object class="GtkBox" id="header_box">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkSwitch" id="enable_switch">
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="valign">center</property>
<signal name="state-set" handler="enable_switch_state_set_cb" object="CcBluetoothPanel" swapped="yes"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="padding">4</property>
<property name="pack_type">end</property>
<property name="position">2</property>
</packing>
</child>
</object>
</interface>