Skip to content
Open
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
6 changes: 2 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
*.o
texit
text_editor
.cache
build/*
.cache/
build/
compile_commands.json
3 changes: 2 additions & 1 deletion .gresource.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
<file>main-window.ui</file>
<file>share-dialog.ui</file>
<file>style.css</file>
<file>settings.ui</file>
</gresource>
</gresources>
</gresources>
9 changes: 9 additions & 0 deletions include/settings.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#ifndef __SETTINGS_H_
#define __SETTINGS_H_

#include <gtk/gtk.h>
#include <adwaita.h>

void settings_click(GtkButton* setting_btn, GtkWindow* window);

#endif // __SETTINGS_H_
9 changes: 8 additions & 1 deletion res/main-window.blp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,14 @@ Adw.ApplicationWindow main-window {
}
[end]
// label set in program
ToggleButton share-toggle { label: "❌ Share";}
ToggleButton share-toggle {
label: "❌ Share";
}
[end]
Button settings-btn {
Image { icon-name: "emblem-system-symbolic"; }
tooltip-text: "Settings";
}
}

Gtk.Label label{
Expand Down
59 changes: 59 additions & 0 deletions res/settings.blp
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
using Gtk 4.0;
using Gio 2.0;
using Adw 1;


Adw.PreferencesWindow setting-dialog {
default-width: 200;
default-height: 400;

Adw.PreferencesPage font-page {
title: "Font";
Adw.PreferencesGroup {
title: "Font Customization";
description: "These are all the font customizability options that TeXiT currently supports.";
Adw.ActionRow {
title: "Font Family and Size";
Gtk.FontDialogButton font-dialog {}
}
Separator { styles ["spacer"] }
Adw.ComboRow font-style-row {
title: "Font Style";
subtitle: "Choose whether to display the text editor in bold, italic, bold italic, or none.";
model: Gtk.StringList {
strings [
"None",
"Bold",
"Italic",
"Bold Italic"
]
};
}
Separator { styles ["spacer"] }
Adw.ActionRow {
title: "Ligature";
subtitle: "Merge symbols (e.g. <=, >=)";
use-markup: false;
Gtk.Switch ligatures-switch {
vexpand: false;
valign: center;
}
}
}
}
Adw.PreferencesPage page-2 {
Adw.PreferencesGroup {

}
}
Adw.PreferencesPage page-3 {
Adw.PreferencesGroup {

}
}
Adw.PreferencesPage page-4 {
Adw.PreferencesGroup {

}
}
}
4 changes: 4 additions & 0 deletions src/gui.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "tab-page.h"
#include "server.h"
#include "client.h"
#include "settings.h"
#include <stdio.h>
#include <string.h>

Expand Down Expand Up @@ -209,6 +210,9 @@ void main_window(AdwApplication *app) {
gtk_button_set_label(GTK_BUTTON(share_toggle), TOGGLE_LABEL_OFF);
g_signal_connect(share_toggle, "clicked", G_CALLBACK(share_toggle_click), share_click_params);

GtkButton* settings_btn = GTK_BUTTON(gtk_builder_get_object(builder, "settings-btn"));
g_signal_connect(settings_btn, "clicked", G_CALLBACK(settings_click), window);

gtk_window_present(GTK_WINDOW(window));
}

Expand Down
9 changes: 9 additions & 0 deletions src/settings.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#include "settings.h"

void settings_click(GtkButton* settings_btn, GtkWindow* window){
GtkBuilder* settings_builder = gtk_builder_new_from_resource("/me/Asder8215/TeXiT/settings.ui");
AdwPreferencesWindow* prefs_window = ADW_PREFERENCES_WINDOW(gtk_builder_get_object(settings_builder, "setting-dialog"));
gtk_window_set_transient_for(GTK_WINDOW(prefs_window), window);
gtk_window_present(GTK_WINDOW(prefs_window));
}