Skip to content

Commit

Permalink
Update styles
Browse files Browse the repository at this point in the history
  • Loading branch information
alainm23 committed Mar 20, 2024
1 parent 2206d2c commit 212fd37
Show file tree
Hide file tree
Showing 16 changed files with 124 additions and 111 deletions.
9 changes: 5 additions & 4 deletions core/Layouts/HeaderItem.vala
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public class Layouts.HeaderItem : Adw.Bin {
set {
if (value) {
listbox.css_classes = { "boxed-list" };
listbox.margin_top = 3;
listbox.margin_top = 12;
listbox.margin_bottom = 3;
listbox.margin_start = 3;
listbox.margin_end = 3;
Expand All @@ -147,11 +147,12 @@ public class Layouts.HeaderItem : Adw.Bin {
halign = Gtk.Align.START
};

name_label.add_css_class (Granite.STYLE_CLASS_H4_LABEL);
name_label.add_css_class (Granite.STYLE_CLASS_SMALL_LABEL);
name_label.add_css_class ("h4");
name_label.add_css_class ("heading");

listbox = new Gtk.ListBox () {
hexpand = true
hexpand = true,
margin_top = 6
};

listbox.set_placeholder (get_placeholder ());
Expand Down
2 changes: 1 addition & 1 deletion core/Util/Util.vala
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,7 @@ public class Util : GLib.Object {

dialog.body_use_markup = true;
dialog.add_response ("cancel", _("Cancel"));
dialog.add_response ("delete", _("Reset all"));
dialog.add_response ("delete", _("Delete All"));
dialog.set_response_appearance ("delete", Adw.ResponseAppearance.DESTRUCTIVE);
dialog.show ();

Expand Down
4 changes: 2 additions & 2 deletions core/Widgets/ContextMenu/MenuItem.vala
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public class Widgets.ContextMenu.MenuItem : Gtk.Button {
}

construct {
add_css_class (Granite.STYLE_CLASS_FLAT);
add_css_class ("flat");
add_css_class ("no-font-bold");

menu_icon = new Gtk.Image () {
Expand All @@ -125,7 +125,7 @@ public class Widgets.ContextMenu.MenuItem : Gtk.Button {
child = select_icon
};

var arrow_icon = new Gtk.Image.from_icon_name ("pan-end-symbolic") {
var arrow_icon = new Gtk.Image.from_icon_name ("go-next-symbolic") {
css_classes = { "dim-label" },
margin_start = 6
};
Expand Down
4 changes: 2 additions & 2 deletions core/Widgets/DateTimePicker/DateTimePicker.vala
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ public class Widgets.DateTimePicker.DateTimePicker : Gtk.Popover {

construct {
today_item = new Widgets.ContextMenu.MenuItem (_("Today"), "star-outline-thick-symbolic");
tomorrow_item = new Widgets.ContextMenu.MenuItem (_("Tomorrow"), "month-symbolic");
next_week_item = new Widgets.ContextMenu.MenuItem (_("Next week"), "month-symbolic");
tomorrow_item = new Widgets.ContextMenu.MenuItem (_("Tomorrow"), "today-calendar-symbolic");
next_week_item = new Widgets.ContextMenu.MenuItem (_("Next week"), "work-week-symbolic");
date_item = new Widgets.ContextMenu.MenuItem (_("Choose a date"), "month-symbolic");
date_item.arrow = true;

Expand Down
2 changes: 2 additions & 0 deletions data/io.github.alainm23.planify.gresource.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,7 @@
<file alias="list-drag-handle-symbolic.svg">resources/icons/list-drag-handle-symbolic.svg</file>
<file alias="mailbox-symbolic.svg">resources/icons/mailbox-symbolic.svg</file>
<file alias="checkmark-small-symbolic.svg">resources/icons/checkmark-small-symbolic.svg</file>
<file alias="work-week-symbolic.svg">resources/icons/work-week-symbolic.svg</file>
<file alias="permissions-generic-symbolic.svg">resources/icons/permissions-generic-symbolic.svg</file>
</gresource>
</gresources>
8 changes: 8 additions & 0 deletions data/resources/icons/permissions-generic-symbolic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions data/resources/icons/work-week-symbolic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 6 additions & 2 deletions data/resources/stylesheet/stylesheet.css
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,10 @@ entry.flat:focus-within {

.card-selected {
transition: all 225ms ease-in-out;
margin: 24px;
margin-bottom: 24px;
margin-top: 24px;
margin-left: 3px;
margin-right: 3px;
padding-left: 9px;
padding-top: 3px;
padding-right: 3px;
Expand Down Expand Up @@ -535,7 +538,8 @@ checkbutton.theme-selector radio:checked {
color: @theme_selected_fg_color;
}

.header-item-button {
.header-item-button,
.header-item-button button {
padding: 3px;
min-height: 16px;
min-width: 16px;
Expand Down
30 changes: 0 additions & 30 deletions data/resources/stylesheet/typography.css
Original file line number Diff line number Diff line change
@@ -1,33 +1,3 @@
.h1,
.title-1 {
font-size: 24pt;
font-weight: 700;
letter-spacing: -0.04em;
}

.h2,
.title-2 {
font-weight: 300;
font-size: 18pt;
letter-spacing: -0.05em;
}

.h3,
.title-3 {
font-size: 11pt;
}

label.h4,
.h4 label,
.heading,
.title-4,
.title-4 label {
font-weight: 700;
opacity: 0.8;
padding-bottom: 0.5em;
padding-top: 0.5em;
}

.small-label {
font-size: 0.85em;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Dialogs/DatePicker.vala
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ public class Dialogs.DatePicker : Adw.Window {
today_item.secondary_text = new GLib.DateTime.now_local ().format ("%a");
today_item.margin_top = 6;

var tomorrow_item = new Widgets.ContextMenu.MenuItem (_("Tomorrow"), "month-symbolic");
var tomorrow_item = new Widgets.ContextMenu.MenuItem (_("Tomorrow"), "today-calendar-symbolic");
tomorrow_item.secondary_text = new GLib.DateTime.now_local ().add_days (1).format ("%a");

var next_week_item = new Widgets.ContextMenu.MenuItem (_("Next Week"), "month-symbolic");
var next_week_item = new Widgets.ContextMenu.MenuItem (_("Next Week"), "work-week-symbolic");
next_week_item.secondary_text = Util.get_default ().get_relative_date_from_date (
Util.get_default ().get_format_date (new GLib.DateTime.now_local ().add_days (7))
);
Expand Down
1 change: 0 additions & 1 deletion src/Dialogs/Preferences/Pages/Sidebar.vala
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ public class Dialogs.Preferences.Pages.Sidebar : Adw.Bin {
var settings_header = new Dialogs.Preferences.SettingsHeader (_("Sidebar"));

var views_group = new Layouts.HeaderItem (_("Show in Sidebar")) {
listbox_no_margin = true,
card = true,
reveal = true,
margin_top = 12
Expand Down
4 changes: 2 additions & 2 deletions src/Dialogs/Preferences/PreferencesWindow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,8 @@ public class Dialogs.Preferences.PreferencesWindow : Adw.PreferencesWindow {

delete_row.activated.connect (() => {
destroy ();
Util.get_default ().clear_database (_("Are you sure you want to reset all?"),
_("The process removes all stored information without the possibility of undoing it"),
Util.get_default ().clear_database (_("Delete All Data?"),
_("Deletes all your lists, tasks, and reminders irreversibly"),
Planify.instance.main_window);
});

Expand Down
14 changes: 11 additions & 3 deletions src/Layouts/ItemRow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ public class Layouts.ItemRow : Layouts.ItemBase {
child = content_textview
};

hide_loading_button = new Widgets.LoadingButton.with_icon ("pan-down-symbolic", 16) {
hide_loading_button = new Widgets.LoadingButton.with_icon ("go-up-symbolic", 16) {
valign = Gtk.Align.START,
css_classes = { "flat", "dim-label", "no-padding" }
};
Expand Down Expand Up @@ -971,6 +971,8 @@ public class Layouts.ItemRow : Layouts.ItemBase {
}

private Gtk.Popover build_button_context_menu () {
var back_item = new Widgets.ContextMenu.MenuItem (_("Back"), "go-previous-symbolic");

var copy_clipboard_item = new Widgets.ContextMenu.MenuItem (_("Copy to Clipboard"), "clipboard-symbolic");
var duplicate_item = new Widgets.ContextMenu.MenuItem (_("Duplicate"), "tabs-stack-symbolic");
var move_item = new Widgets.ContextMenu.MenuItem (_("Move"), "arrow3-right-symbolic");
Expand Down Expand Up @@ -1006,7 +1008,7 @@ public class Layouts.ItemRow : Layouts.ItemBase {
};

menu_stack.add_named (menu_box, "menu");
menu_stack.add_named (get_repeat_widget (popover), "repeat");
menu_stack.add_named (get_repeat_widget (popover, back_item), "repeat");

popover.child = menu_stack;

Expand Down Expand Up @@ -1046,6 +1048,10 @@ public class Layouts.ItemRow : Layouts.ItemBase {
menu_stack.set_visible_child_name ("menu");
});

back_item.clicked.connect (() => {
menu_stack.set_visible_child_name ("menu");
});

popover.show.connect (() => {
more_information_item.title = get_updated_info ();
});
Expand All @@ -1058,7 +1064,7 @@ public class Layouts.ItemRow : Layouts.ItemBase {
return popover;
}

private Gtk.Widget get_repeat_widget (Gtk.Popover popover) {
private Gtk.Widget get_repeat_widget (Gtk.Popover popover, Widgets.ContextMenu.MenuItem back_item) {
var none_item = new Widgets.ContextMenu.MenuItem (_("None"));
var daily_item = new Widgets.ContextMenu.MenuItem (_("Daily"));
var weekly_item = new Widgets.ContextMenu.MenuItem (_("Weekly"));
Expand All @@ -1068,6 +1074,8 @@ public class Layouts.ItemRow : Layouts.ItemBase {

var menu_box = new Gtk.Box (Gtk.Orientation.VERTICAL, 0);
menu_box.margin_top = menu_box.margin_bottom = 3;
menu_box.append (back_item);
menu_box.append (new Widgets.ContextMenu.MenuSeparator ());
menu_box.append (daily_item);
menu_box.append (weekly_item);
menu_box.append (monthly_item);
Expand Down
Loading

0 comments on commit 212fd37

Please sign in to comment.