Commit 6ecd0bcc authored by Christopher Davis's avatar Christopher Davis

Implemented text dimming

parent ed3a7283
......@@ -37,6 +37,7 @@
<object class="GtkSwitch" id="markdown_switch">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="margin_left">42</property>
</object>
<packing>
<property name="expand">False</property>
......@@ -64,7 +65,7 @@
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_left">40</property>
<property name="margin_left">42</property>
<property name="label" translatable="yes">&gt; quote</property>
</object>
<packing>
......@@ -91,7 +92,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="margin_left">40</property>
<property name="margin_left">42</property>
<property name="label" translatable="yes">`code`</property>
</object>
<packing>
......@@ -114,6 +115,9 @@
<property name="top_attach">0</property>
</packing>
</child>
<style>
<class name="dim-label"/>
</style>
</object>
<packing>
<property name="expand">False</property>
......
......@@ -2923,6 +2923,10 @@ impl App {
.get_object("markdown_switch")
.expect("Couldn't find markdown_switch in ui file.");
let txt: gtk::Grid = self.ui.builder
.get_object("tutorial_text_box")
.expect("Couldn't find tutorial_text_box in ui file.");
let md_img = self.ui.builder
.get_object::<gtk::Image>("md_img")
.expect("Couldn't find md_img in ui file.");
......@@ -2934,8 +2938,10 @@ impl App {
op.lock().unwrap().md_enabled = markdown_switch.get_active();
if !markdown_switch.get_active() {
md_img.set_from_icon_name("format-justify-left-symbolic",1);
txt.get_style_context().unwrap().add_class("dim-label");
} else {
md_img.set_from_icon_name("format-indent-more-symbolic",1);
txt.get_style_context().unwrap().remove_class("dim-label");
}
});
}
......
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