Skip to content

Commit

Permalink
Fix #693
Browse files Browse the repository at this point in the history
  • Loading branch information
Alain M committed Feb 12, 2021
1 parent aedba5a commit 59ef061
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 15 deletions.
3 changes: 2 additions & 1 deletion data/stylesheet.css
Original file line number Diff line number Diff line change
Expand Up @@ -781,10 +781,11 @@ paned.horizontal > separator {
background-color: @projectview_color;
padding-left: 0px;
border-bottom: none;
box-shadow: none;
}

.menu-button {
padding: 3px;
padding: 3px 6px 3px 6px;
}

.project-name-entry {
Expand Down
5 changes: 3 additions & 2 deletions plugins/sidebar-labels/LabelSidebar.vala
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,13 @@ public class Plugins.LabelSidebar : Peas.ExtensionBase, Peas.Activatable {
var top_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0);
top_box.margin_top = 3;
top_box.margin_bottom = 3;
top_box.margin_start = 6;
// top_box.pack_start (arrow_button, false, false, 0);
top_box.pack_start (name_label, false, true, 0);
top_box.pack_end (menu_stack, false, false, 0);

top_eventbox = new Gtk.EventBox ();
top_eventbox.margin_start = 12;
top_eventbox.margin_start = 3;
top_eventbox.margin_end = 3;
top_eventbox.add_events (Gdk.EventMask.ENTER_NOTIFY_MASK | Gdk.EventMask.LEAVE_NOTIFY_MASK);
top_eventbox.add (top_box);
Expand Down Expand Up @@ -179,7 +180,7 @@ public class Plugins.LabelSidebar : Peas.ExtensionBase, Peas.Activatable {

private void toggle_hidden () {
top_eventbox.get_style_context ().add_class ("active");
Timeout.add (750, () => {
Timeout.add (listbox_revealer.transition_duration, () => {
top_eventbox.get_style_context ().remove_class ("active");
return GLib.Source.REMOVE;
});
Expand Down
4 changes: 1 addition & 3 deletions src/Dialogs/Preferences/Preferences.vala
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,14 @@ public class Dialogs.Preferences.Preferences : Gtk.Dialog {

var stack_scrolled = new Gtk.ScrolledWindow (null, null);
stack_scrolled.hscrollbar_policy = Gtk.PolicyType.NEVER;
stack_scrolled.width_request = 246;
stack_scrolled.vscrollbar_policy = Gtk.PolicyType.NEVER;
stack_scrolled.expand = true;
stack_scrolled.add (stack);

var content_area = get_content_area ();
content_area.border_width = 0;
content_area.add (stack_scrolled);

// add_button (_("Close"), Gtk.ResponseType.CLOSE);

Planner.utils.init_labels_color ();

response.connect ((response_id) => {
Expand Down
1 change: 1 addition & 0 deletions src/Widgets/LabelFilter.vala
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ public class Widgets.LabelFilterRow : Gtk.ListBoxRow {
grid.show_all ();

var button = new Gtk.ModelButton ();
button.get_style_context ().add_class ("menu-button");
button.get_child ().destroy ();
button.add (grid);

Expand Down
2 changes: 1 addition & 1 deletion src/Widgets/LabelPreview.vala
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public class Widgets.LabelPreview : Gtk.EventBox {
name_label.use_markup = true;

var box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 3);
box.get_style_context ().add_class ("label-preview-%s".printf (label.id.to_string ()));
box.get_style_context ().add_class ("label-%s".printf (label.id.to_string ()));
box.add (name_label);

add (box);
Expand Down
18 changes: 10 additions & 8 deletions src/Widgets/SectionRow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ public class Widgets.SectionRow : Gtk.ListBoxRow {
name_entry.placeholder_text = _("Section name");
name_entry.get_style_context ().add_class ("font-bold");
name_entry.get_style_context ().add_class ("flat");
name_entry.get_style_context ().add_class ("project-name-entry");
name_entry.get_style_context ().add_class ("no-padding");
name_entry.get_style_context ().add_class ("header-entry");

name_stack = new Gtk.Stack ();
name_stack.margin_start = 9;
Expand Down Expand Up @@ -216,6 +216,7 @@ public class Widgets.SectionRow : Gtk.ListBoxRow {
separator = new Gtk.Separator (Gtk.Orientation.HORIZONTAL);
separator.margin_start = 42;
separator.margin_end = 40;
separator.margin_top = 3;

separator_revealer = new Gtk.Revealer ();
separator_revealer.transition_type = Gtk.RevealerTransitionType.CROSSFADE;
Expand Down Expand Up @@ -569,6 +570,7 @@ public class Widgets.SectionRow : Gtk.ListBoxRow {

new_section_eventbox.button_press_event.connect ((sender, evt) => {
if (section.id != 0 && evt.type == Gdk.EventType.BUTTON_PRESS && evt.button == 1) {
new_section_revealer.reveal_child = false;
add_new_section_row (get_index ());
}
});
Expand Down Expand Up @@ -622,7 +624,7 @@ public class Widgets.SectionRow : Gtk.ListBoxRow {
action_revealer.reveal_child = true;
name_stack.visible_child_name = "name_entry";

separator_revealer.reveal_child = false;
// separator_revealer.reveal_child = false;

name_entry.grab_focus_without_selecting ();
if (name_entry.cursor_position < name_entry.text_length) {
Expand Down Expand Up @@ -707,7 +709,7 @@ public class Widgets.SectionRow : Gtk.ListBoxRow {

name_entry.activate.connect (() =>{
save ();
separator_revealer.reveal_child = true;
// separator_revealer.reveal_child = true;
});

name_entry.key_release_event.connect ((key) => {
Expand All @@ -716,23 +718,23 @@ public class Widgets.SectionRow : Gtk.ListBoxRow {
name_stack.visible_child_name = "name_label";
name_entry.text = section.name;

separator_revealer.reveal_child = true;
// separator_revealer.reveal_child = true;
}

return false;
});

submit_button.clicked.connect (() => {
save ();
separator_revealer.reveal_child = true;
// separator_revealer.reveal_child = true;
});

cancel_button.clicked.connect (() => {
action_revealer.reveal_child = false;
name_stack.visible_child_name = "name_label";
name_entry.text = section.name;

separator_revealer.reveal_child = true;
// separator_revealer.reveal_child = true;
});

menu_button.clicked.connect (() => {
Expand Down Expand Up @@ -1158,7 +1160,7 @@ public class Widgets.SectionRow : Gtk.ListBoxRow {
action_revealer.reveal_child = true;
name_stack.visible_child_name = "name_entry";

separator_revealer.reveal_child = false;
// separator_revealer.reveal_child = false;

name_entry.grab_focus_without_selecting ();
if (name_entry.cursor_position < name_entry.text_length) {
Expand Down Expand Up @@ -1249,7 +1251,7 @@ public class Widgets.SectionRow : Gtk.ListBoxRow {
}

top_eventbox.get_style_context ().add_class ("active");
toggle_timeout = Timeout.add (750, () => {
toggle_timeout = Timeout.add (listbox_revealer.transition_duration, () => {
toggle_timeout = 0;
top_eventbox.get_style_context ().remove_class ("active");
return GLib.Source.REMOVE;
Expand Down

0 comments on commit 59ef061

Please sign in to comment.