Skip to content

Commit

Permalink
Remember state
Browse files Browse the repository at this point in the history
  • Loading branch information
sonnyp committed Jan 3, 2022
1 parent 77c8b93 commit 40312bc
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion data/re.sonny.Webground.gschema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<default>true</default>
</key>
<key name="show-devtools" type="b">
<default>false</default>
<default>true</default>
</key>
</schema>
</schemalist>
2 changes: 1 addition & 1 deletion po/re.sonny.Webground.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: re.sonny.Webground\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-01-02 16:50+0100\n"
"POT-Creation-Date: 2022-01-04 00:47+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down
16 changes: 11 additions & 5 deletions src/window.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Gtk from "gi://Gtk";
// import Gdk from "gi://Gdk";
import GObject from "gi://GObject";
// import Gio from "gi://Gio";
import Gio from "gi://Gio";
import WebKit from "gi://WebKit2?version=5.0";
import Source from "gi://GtkSource?version=5";

Expand All @@ -10,10 +10,10 @@ import Shortcuts from "./Shortcuts.js";
import Devtools from "./Devtools.js";
import WebView from "./WebView.js";

// const settings = new Gio.Settings({
// schema_id: "re.sonny.Webground",
// path: "/re/sonny/Webground/",
// });
const settings = new Gio.Settings({
schema_id: "re.sonny.Webground",
path: "/re/sonny/Webground/",
});

export default function Welcome({ application }) {
// Solves
Expand Down Expand Up @@ -57,6 +57,12 @@ export default function Welcome({ application }) {
const button_output = builder.get_object("button_output");
const button_devtools = builder.get_object("button_devtools");

settings.bind('show-html', button_html, 'active', Gio.SettingsBindFlags.DEFAULT);
settings.bind('show-css', button_css, 'active', Gio.SettingsBindFlags.DEFAULT);
settings.bind('show-javascript', button_javascript, 'active', Gio.SettingsBindFlags.DEFAULT);
settings.bind('show-output', button_output, 'active', Gio.SettingsBindFlags.DEFAULT);
settings.bind('show-devtools', button_devtools, 'active', Gio.SettingsBindFlags.DEFAULT);

button_html.bind_property(
"active",
source_view_html.parent,
Expand Down

0 comments on commit 40312bc

Please sign in to comment.