Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions data/jorts.gschema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,10 @@
<summary>Hide actionbar</summary>
<description>Whether to hide the actionbar and its buttons</description>
</key>
<key name="list-item-start" type="s">
<default>" - "</default>
<summary>Hide actionbar</summary>
<description>Whether to hide the actionbar and its buttons</description>
</key>
</schema>
</schemalist>
4 changes: 3 additions & 1 deletion data/jorts.metainfo.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
<p>🚀 4.0.0 Jorts of Hyperspace!</p>
<ul>
<li>Version 4 to align with Gtk version</li>
<li>Added button to toggle lists, and ability to customize them</li>
<li>Ctrl+Scroll to zoom-in, zoom-out</li>
<li>More zoom options</li>
<li>Keyboard shortcuts work from popover now</li>
Expand All @@ -114,7 +115,8 @@
<issues>
<issue url="https://github.com/ellie-commons/jorts/issues/79">Fixed zoom impacting emojichooser and context menu</issue>
<issue url="https://github.com/ellie-commons/jorts/issues/95">Fixed coloring bleeding into icons in emojichooser and context menu</issue>
<issue url="https://github.com/ellie-commons/jorts/issues/78">Fixed absence of Ctrl+scroll</issue>
<issue url="https://github.com/ellie-commons/jorts/issues/78">Added Ctrl+scroll</issue>
<issue url="https://github.com/ellie-commons/jorts/issues/63">Added list feature</issue>
</issues>
</release>
<release version="3.5.0" date="2025-11-06">
Expand Down
1 change: 1 addition & 0 deletions src/Application.vala
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ public class Jorts.Application : Gtk.Application {
set_accels_for_action ("win.action_toggle_mono", {"<Control>m"});
set_accels_for_action ("win.action_focus_title", {"<Control>L"});
set_accels_for_action ("win.action_show_emoji", {"<Control>period"});
set_accels_for_action ("win.action_toggle_list", {"<Shift>F12"});
set_accels_for_action ("win.action_show_menu", {"<Control>G", "<Control>O"});

set_accels_for_action ("win.action_theme_1", {"<Alt>1"});
Expand Down
2 changes: 1 addition & 1 deletion src/Services/Constants.vala
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ namespace Jorts.Constants {

// New preference window
const int DEFAULT_PREF_WIDTH = 550;
const int DEFAULT_PREF_HEIGHT = 290;
const int DEFAULT_PREF_HEIGHT = 310;

/*************************************************/
// Shortcuts
Expand Down
2 changes: 2 additions & 0 deletions src/Views/NoteView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@
emojichooser_popover.show.connect (randomize_emote_button);
emojichooser_popover.emoji_picked.connect (on_emoji_picked);
//Application.gsettings.bind ("hide-bar", actionbar, "revealed", SettingsBindFlags.INVERT_BOOLEAN);

//textview.bind_property ("on_list_item", actionbar.list_button, "active", GLib.BindingFlags.DEFAULT);
}

// Randomize the button emoji when clicked
Expand Down
97 changes: 74 additions & 23 deletions src/Views/PreferencesView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@

construct {
orientation = VERTICAL;
margin_top = 12;
margin_bottom = 12;
margin_start = 12;
margin_end = 12;
margin_top = 10;
margin_bottom = 10;
margin_start = 10;
margin_end = 10;

var overlay = new Gtk.Overlay ();
append (overlay);
Expand All @@ -24,15 +24,48 @@
overlay.add_overlay (toast);

// the box with all the settings
var settingsbox = new Gtk.Box (VERTICAL, 24) {
margin_top = 6,
margin_start = 6,
margin_end = 6,
var settingsbox = new Gtk.Box (VERTICAL, 20) {
margin_top = 5,
margin_start = 5,
margin_end = 5,
hexpand = true,
vexpand = true,
valign = Gtk.Align.START
};


/***************************************/
/* lists */
/***************************************/

var lists_box = new Gtk.Box (HORIZONTAL, 5);

var list_entry = new Gtk.Entry () {
halign = Gtk.Align.END,
hexpand = false,
valign = Gtk.Align.CENTER,
max_length = 5,
max_width_chars = 5
};

var list_label = new Granite.HeaderLabel (_("List item symbol")) {
mnemonic_widget = list_entry,
secondary_text = _("Prefix by which to begin each item in a list. If there is no prefix, the toggle list button will be hidden"),
hexpand = true
};

lists_box.append (list_label);
lists_box.append (list_entry);

Application.gsettings.bind (
"list-item-start",
list_entry, "text",
SettingsBindFlags.DEFAULT);


settingsbox.append (lists_box);


/*************************************************/
/* scribbly Toggle */
/*************************************************/
Expand Down Expand Up @@ -63,13 +96,13 @@
/* Autostart Request */
/****************************************************/
#if !WINDOWS
var both_buttons = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 6) {
var both_buttons = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 5) {
halign = Gtk.Align.FILL
};

///TRANSLATORS: Button to autostart the application
var set_autostart = new Gtk.Button () {
label = _("Set autostart"),
label = _("Autostart"),
valign = Gtk.Align.CENTER
};

Expand All @@ -94,7 +127,7 @@
both_buttons.append (set_autostart);
both_buttons.append (remove_autostart);

var autostart_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 6);
var autostart_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 5);

var autostart_label = new Granite.HeaderLabel (_("Allow to start at login")) {
mnemonic_widget = both_buttons,
Expand All @@ -109,12 +142,12 @@
/*************************************************/
// Bar at the bottom
var actionbar = new Gtk.CenterBox () {
margin_start = 6,
margin_end = 6,
valign = Gtk.Align.END
margin_start = 5,
margin_end = 5,
valign = Gtk.Align.END,
hexpand = true,
vexpand = false
};
actionbar.set_hexpand (true);
actionbar.set_vexpand (false);

// Monies?
var support_button = new Gtk.LinkButton.with_label (
Expand All @@ -123,12 +156,6 @@
);
actionbar.start_widget = support_button;

// Reset
//reset_button = new Gtk.Button ();
//reset_button.set_label ( _("Reset to Default"));
//reset_button.tooltip_markup = (_("Reset all settings to defaults"));
//actionbar.pack_end (reset_button);

close_button = new Gtk.Button () {
width_request = 96,
label = _("Close"),
Expand All @@ -137,9 +164,33 @@
_("Close preferences")
)
};
actionbar.end_widget = close_button;

var reset = new Gtk.Button.from_icon_name ("system-reboot-symbolic") {
tooltip_markup = _("Reset all settings to defaults"),
valign = Gtk.Align.CENTER
};
reset.clicked.connect (on_reset);

var end_box = new Gtk.Box (HORIZONTAL, 5);
end_box.append (reset);
end_box.append (close_button);
actionbar.end_widget = end_box;

append (settingsbox);
append (actionbar);
}

private void on_reset () {
debug ("Resetting settings…");

string[] keys = {"scribbly-mode-active", "hide-bar", "list-item-start"};
foreach (var key in keys) {
Application.gsettings.reset (key);
}

#if !WINDOWS
Jorts.Utils.autostart_remove ();
toast.send_notification ();
#endif
}
}
23 changes: 23 additions & 0 deletions src/Widgets/ActionBar.vala
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
public class Jorts.ActionBar : Granite.Bin {

public Gtk.ActionBar actionbar;
public Gtk.Button list_button;
public Gtk.MenuButton emoji_button;
public Gtk.EmojiChooser emojichooser_popover;
public Gtk.MenuButton menu_button;
Expand Down Expand Up @@ -45,6 +46,18 @@
delete_item.action_name = StickyNoteWindow.ACTION_PREFIX + StickyNoteWindow.ACTION_DELETE;

/* **** RIGHT **** */
list_button = new Gtk.Button () {
icon_name = "view-list-symbolic",
width_request = 32,
height_request = 32,
tooltip_markup = Granite.markup_accel_tooltip (
{"<Shift>F12"},
_("Toggle list")
)
};
list_button.add_css_class ("themedbutton");
list_button.action_name = StickyNoteWindow.ACTION_PREFIX + StickyNoteWindow.ACTION_TOGGLE_LIST;

emojichooser_popover = new Gtk.EmojiChooser ();

emoji_button = new Gtk.MenuButton () {
Expand Down Expand Up @@ -80,6 +93,7 @@
actionbar.pack_start (delete_item);
actionbar.pack_end (menu_button);
actionbar.pack_end (emoji_button);
actionbar.pack_end (list_button);

handle = new Gtk.WindowHandle () {
child = actionbar
Expand All @@ -89,6 +103,11 @@

// Randomize-skip emoji icon
emojichooser_popover.show.connect (on_emoji_popover);

// Hide the list button if user has specified no list item symbol
on_prefix_changed ();
Application.gsettings.changed["list-item-start"].connect (on_prefix_changed);

}

/**
Expand All @@ -109,4 +128,8 @@
)
);
}

private void on_prefix_changed () {
list_button.visible = (Application.gsettings.get_string ("list-item-start") != "");
}
}
2 changes: 1 addition & 1 deletion src/Widgets/PreferencesWidgets/SettingsSwitch.vala
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class Jorts.SettingsSwitch : Gtk.Box {

public SettingsSwitch (string name, string explanation, string key) {
orientation = Gtk.Orientation.HORIZONTAL;
spacing = 6;
spacing = 5;

var toggle = new Gtk.Switch () {
halign = Gtk.Align.END,
Expand Down
Loading