Compare commits

..

No commits in common. "main" and "0.97.7" have entirely different histories.
main ... 0.97.7

4 changed files with 2 additions and 1869 deletions

View File

@ -27,7 +27,7 @@ import os
import locale import locale
import tempfile import tempfile
from gi.repository import GLib, GObject, Gio, Gdk, Gtk, Pango, Adw, GtkSource from gi.repository import GLib, GObject, Gio, Gdk, Gtk, Pango, Adw
from .cmb_tutor import CmbTutor, CmbTutorState from .cmb_tutor import CmbTutor, CmbTutorState
from . import cmb_tutorial from . import cmb_tutorial
@ -120,9 +120,6 @@ class CmbWindow(Adw.ApplicationWindow):
intro_button = Gtk.Template.Child() intro_button = Gtk.Template.Child()
menu_button = Gtk.Template.Child() menu_button = Gtk.Template.Child()
# Properties
source_style = GObject.Property(type=GtkSource.StyleScheme, flags=GObject.ParamFlags.READWRITE)
# Settings # Settings
completed_intro = GObject.Property(type=bool, default=False, flags=GObject.ParamFlags.READWRITE) completed_intro = GObject.Property(type=bool, default=False, flags=GObject.ParamFlags.READWRITE)
@ -305,10 +302,6 @@ class CmbWindow(Adw.ApplicationWindow):
self.__load_window_state() self.__load_window_state()
self.__update_actions() self.__update_actions()
self.source_style_manager = GtkSource.StyleSchemeManager.get_default()
app.props.style_manager.connect("notify::dark", lambda o, p: self.__update_dark_mode(app.props.style_manager))
self.__update_dark_mode(app.props.style_manager)
# Bind preview # Bind preview
hide_placeholders_button = Gtk.ToggleButton(tooltip_text=_("Hide placeholders"), icon_name="view-conceal-symbolic") hide_placeholders_button = Gtk.ToggleButton(tooltip_text=_("Hide placeholders"), icon_name="view-conceal-symbolic")
self.type_chooser.content.append(hide_placeholders_button) self.type_chooser.content.append(hide_placeholders_button)
@ -479,14 +472,6 @@ class CmbWindow(Adw.ApplicationWindow):
self.np_ui_entry.set_sensitive(sensitive) self.np_ui_entry.set_sensitive(sensitive)
self.__update_action_new() self.__update_action_new()
def __update_dark_mode(self, style_manager):
if style_manager.props.dark:
self.source_style = self.source_style_manager.get_scheme("Adwaita-dark")
self.add_css_class("dark")
else:
self.remove_css_class("dark")
self.source_style = self.source_style_manager.get_scheme("Adwaita")
def __np_name_to_ui(self, binding, value): def __np_name_to_ui(self, binding, value):
if len(value): if len(value):
return value.lower().rsplit(".", 1)[0] + ".ui" return value.lower().rsplit(".", 1)[0] + ".ui"

View File

@ -23,7 +23,7 @@
# SPDX-License-Identifier: LGPL-2.1-only # SPDX-License-Identifier: LGPL-2.1-only
# #
from gi.repository import GObject, Gtk, GtkSource from gi.repository import GObject, GtkSource
class CmbSourceView(GtkSource.View): class CmbSourceView(GtkSource.View):
@ -38,27 +38,6 @@ class CmbSourceView(GtkSource.View):
self.props.buffer = self.buffer self.props.buffer = self.buffer
self.buffer.connect("changed", self.__on_buffer_changed) self.buffer.connect("changed", self.__on_buffer_changed)
self.connect("notify::root", self.__on_parent_notify)
self.__source_style_binding = None
def __on_parent_notify(self, obj, pspec):
if self.__source_style_binding:
self.__source_style_binding.unbind()
self.__source_style_binding = None
root = self.props.root
if root is None:
return
if isinstance(root, Gtk.ApplicationWindow) and hasattr(root, "source_style"):
self.__source_style_binding = GObject.Object.bind_property(
root,
"source-style",
self.buffer,
"style-scheme",
GObject.BindingFlags.SYNC_CREATE,
)
@GObject.Property(type=str) @GObject.Property(type=str)
def lang(self): def lang(self):
language = self.buffer.get_language() language = self.buffer.get_language()

View File

@ -5,6 +5,5 @@ fi
fr fr
it it
nl nl
pt_BR
sv sv
uk uk

File diff suppressed because it is too large Load Diff