Commit d05183c6 authored by Bilal Elmoussaoui's avatar Bilal Elmoussaoui
Browse files

avoid the app breaking on rtl

parent 6dce01bd
......@@ -37,6 +37,7 @@ impl ObjectImpl for ColourEntryPrivate {
self_.set_halign(gtk::Align::Center);
self_.set_valign(gtk::Align::Center);
self_.set_direction(gtk::TextDirection::Ltr);
self_.get_style_context().add_class(&gtk::STYLE_CLASS_LINKED);
self_.set_hexpand(true);
self.entry.set_halign(gtk::Align::Center);
......@@ -62,15 +63,16 @@ impl ObjectImpl for ColourEntryPrivate {
colour_popover.widget.popup();
}));
colour_popover.color_chooser.connect_button_press_event(clone!(@strong colour_popover, @weak self.entry as entry =>
@default-return Inhibit(false), move |_, _| {
colour_popover
.color_chooser
.connect_button_press_event(clone!(@strong colour_popover, @strong self.entry as entry => move |_, _| {
let colour = colour_popover.color_chooser.get_rgba();
let hex_colour = colour::rgba_to_hex(&colour);
entry.set_text(&hex_colour);
colour_popover.widget.popdown();
Inhibit(false)
}));
let colour = colour_popover.color_chooser.get_rgba();
let hex_colour = colour::rgba_to_hex(&colour);
entry.set_text(&hex_colour);
colour_popover.widget.popdown();
Inhibit(false)
}));
self_.pack_start(&self.entry, false, false, 0);
let colour_selector = gtk::Button::new();
......
......@@ -38,6 +38,8 @@ impl ChartBarWidget {
self.container.set_valign(gtk::Align::Center);
self.container.set_halign(gtk::Align::Fill);
self.container.set_hexpand(true);
self.container.set_direction(gtk::TextDirection::Ltr);
self.widget.set_direction(gtk::TextDirection::Ltr);
self.container.get_style_context().add_class("chart-bar");
let drawing_area = gtk::DrawingArea::new();
......@@ -89,6 +91,7 @@ impl ChartBarWidget {
self.filled_container.get_style_context().add_class("filled");
self.filled_container.set_property_height_request(10);
self.filled_container.set_direction(gtk::TextDirection::Ltr);
self.filled_container.show();
self.container.pack_start(&self.filled_container, false, false, 0);
......
......@@ -100,6 +100,7 @@ impl ObjectImpl for WindowPrivate {
entries_container.pack_start(&reverse_btn, false, false, 6);
entries_container.pack_start(&self.fg_entry, false, false, 6);
entries_container.set_halign(gtk::Align::Center);
entries_container.set_direction(gtk::TextDirection::Ltr);
headerbar.set_custom_title(Some(&entries_container));
let primary_menu = gio::Menu::new();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment