aboutsummaryrefslogtreecommitdiffhomepage
path: root/gtk/ScintillaGTK.h
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2021-04-05 08:43:24 +1000
committerNeil <nyamatongwe@gmail.com>2021-04-05 08:43:24 +1000
commitf27b21cb797b856c9f8d2158ba00b6aeccb29680 (patch)
tree47ca43974048b0bfeccb92f843197f83b0087659 /gtk/ScintillaGTK.h
parent8bd3b65c924e56cbd414a71e85b3bafd0c8b17e2 (diff)
downloadscintilla-mirror-f27b21cb797b856c9f8d2158ba00b6aeccb29680.tar.gz
Detect (some) changes to font options and clear position caches when changed.
To experiment, use the Fonts panel of the Tweaks application.
Diffstat (limited to 'gtk/ScintillaGTK.h')
-rwxr-xr-xgtk/ScintillaGTK.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/gtk/ScintillaGTK.h b/gtk/ScintillaGTK.h
index c4437e229..51d51d2ab 100755
--- a/gtk/ScintillaGTK.h
+++ b/gtk/ScintillaGTK.h
@@ -12,6 +12,15 @@ class ScintillaGTKAccessible;
#define OBJECT_CLASS GObjectClass
+struct FontOptions {
+ cairo_antialias_t antialias {};
+ cairo_subpixel_order_t order {};
+ cairo_hint_style_t hint {};
+ FontOptions() noexcept = default;
+ explicit FontOptions(GtkWidget *widget) noexcept;
+ bool operator==(const FontOptions &other) const noexcept;
+};
+
class ScintillaGTK : public ScintillaBase {
friend class ScintillaGTKAccessible;
@@ -69,6 +78,7 @@ class ScintillaGTK : public ScintillaBase {
bool repaintFullWindow;
guint styleIdleID;
+ FontOptions fontOptionsPrevious;
int accessibilityEnabled;
AtkObject *accessible;
@@ -174,6 +184,7 @@ private:
static void GetPreferredHeight(GtkWidget *widget, gint *minimalHeight, gint *naturalHeight);
#endif
static void SizeAllocate(GtkWidget *widget, GtkAllocation *allocation);
+ void CheckForFontOptionChange();
#if GTK_CHECK_VERSION(3,0,0)
gboolean DrawTextThis(cairo_t *cr);
static gboolean DrawText(GtkWidget *widget, cairo_t *cr, ScintillaGTK *sciThis);