From 5d65f1ec8ec5105680ab3f599b6593f70a607dbd Mon Sep 17 00:00:00 2001 From: Subin Siby Date: Mon, 6 Dec 2021 00:28:30 +0530 Subject: [PATCH] Target Ubuntu 14.04 (gtk 3.10) build --- Makefile | 5 +++++ preferences.go | 22 +++++++++------------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index bf7abb7..474c6c7 100644 --- a/Makefile +++ b/Makefile @@ -21,6 +21,11 @@ ibus-xml: $(shell SCHEMES=("ml" "ta" "hi" "te" "ka" "bn"); for s in $${SCHEMES[@]}; do echo $s; ./${BIN} -s $$s -lang $$s -xml component/varnam-$$s.xml -prefix ${INSTALL_PREFIX}; done) +ubuntu-14: + CGO_CFLAGS="-w" go build -tags "pango_1_36,gtk_3_10,glib_2_40,cairo_1_13,gdk_pixbuf_2_30,gtk_deprecated" -ldflags "-s -w" -o ${BIN} . + $(MAKE) ibus-xml + $(MAKE) install-script + ubuntu-18: go build -tags pango_1_42,gtk_3_22 -ldflags "-s -w" -o ${BIN} . $(MAKE) ibus-xml diff --git a/preferences.go b/preferences.go index 55361c6..f60afa8 100644 --- a/preferences.go +++ b/preferences.go @@ -130,8 +130,11 @@ func makeSettingsPage() *gtk.Box { settingsPage, err := gtk.BoxNew(gtk.ORIENTATION_VERTICAL, 6) checkError(err) - settingsPage.SetMarginStart(12) - settingsPage.SetMarginEnd(12) + // gtk_widget_set_margin_left & right is deprecated since 3.12 + // It got removed in 3.98: https://github.com/GNOME/gtk/blob/main/NEWS.pre-4.0#L939 + // Our minimum GTK support needed is 3.10 (Ubuntu 14.04) + settingsPage.SetMarginLeft(12) + settingsPage.SetMarginRight(12) settingsPage.SetMarginBottom(12) /* Dictionary Match Exact Preference */ @@ -326,8 +329,8 @@ func makeRLWPage() *gtk.Box { rlwPage, err := gtk.BoxNew(gtk.ORIENTATION_VERTICAL, 6) checkError(err) - rlwPage.SetMarginStart(12) - rlwPage.SetMarginEnd(12) + rlwPage.SetMarginLeft(12) + rlwPage.SetMarginRight(12) rlwPage.SetMarginTop(12) rlwPage.SetMarginBottom(12) @@ -419,8 +422,8 @@ func showPrefs() { notebook.SetScrollable(true) - notebook.SetMarginStart(12) - notebook.SetMarginEnd(12) + notebook.SetMarginLeft(12) + notebook.SetMarginRight(12) notebook.SetMarginBottom(12) settingsLabel, err := gtk.LabelNew("Settings") @@ -433,13 +436,6 @@ func showPrefs() { win.Add(notebook) - settingsPage, err := gtk.BoxNew(gtk.ORIENTATION_VERTICAL, 6) - checkError(err) - - settingsPage.SetMarginStart(12) - settingsPage.SetMarginEnd(12) - settingsPage.SetMarginBottom(12) - // Recursively show all widgets contained in this window. mainWin.ShowAll()