diff options
Diffstat (limited to 'vcl/unx/gtk3/gtkinst.cxx')
-rw-r--r-- | vcl/unx/gtk3/gtkinst.cxx | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx index b8da4f7b7a..a899fc16c6 100644 --- a/vcl/unx/gtk3/gtkinst.cxx +++ b/vcl/unx/gtk3/gtkinst.cxx @@ -5505,8 +5505,9 @@ public: { GtkBox *pBox = GTK_BOX(gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 6)); GtkWidget *pLabel = gtk_label_new_with_mnemonic(MapToGtkAccelerator(rStr).getStr()); + gtk_label_set_xalign(GTK_LABEL(pLabel), 0.0); pItem = eCheckRadioFalse != TRISTATE_INDET ? gtk_check_menu_item_new() : gtk_menu_item_new(); - gtk_box_pack_start(pBox, pImage, true, true, 0); + gtk_box_pack_start(pBox, pImage, false, true, 0); gtk_box_pack_start(pBox, pLabel, true, true, 0); gtk_container_add(GTK_CONTAINER(pItem), GTK_WIDGET(pBox)); gtk_widget_show_all(pItem); @@ -8745,6 +8746,11 @@ public: gtk_widget_set_size_request(GTK_WIDGET(m_pScrollbar), nThickness, -1); } + virtual void set_scroll_swap_arrows(bool /* bSwap */) override + { + // Related: tdf#93352 do nothing since GtkScrollbar has no arrows + } + virtual ~GtkInstanceScrollbar() override { g_signal_handler_disconnect(m_pAdjustment, m_nAdjustChangedSignalId); @@ -14834,6 +14840,32 @@ private: } #endif + static gboolean search_equal_func(GtkTreeModel *model, + int column, + const char *key, + GtkTreeIter *iter, + gpointer /*user_data*/) + { + GValue aValue = G_VALUE_INIT; + gtk_tree_model_get_value(model, iter, column, &aValue); + + GValue aStringValue = G_VALUE_INIT; + g_value_init(&aStringValue, G_TYPE_STRING); + const bool fail = !g_value_transform(&aValue, &aStringValue); + g_value_unset(&aValue); + if (fail) + return true; + + bool bNoMatch(true); + if (const char *str = g_value_get_string(&aStringValue)) + { + const vcl::I18nHelper& rI18nHelper = Application::GetSettings().GetLocaleI18nHelper(); + bNoMatch = !rI18nHelper.MatchString(OUString::fromUtf8(key), OUString::fromUtf8(str)); + } + g_value_unset(&aStringValue); + return bNoMatch; + } + public: GtkInstanceTreeView(GtkTreeView* pTreeView, GtkInstanceBuilder* pBuilder, bool bTakeOwnership) : GtkInstanceWidget(GTK_WIDGET(pTreeView), pBuilder, bTakeOwnership) @@ -14965,6 +14997,10 @@ public: m_nRowDeletedSignalId = g_signal_connect(m_pTreeModel, "row-deleted", G_CALLBACK(signalRowDeleted), this); m_nRowInsertedSignalId = g_signal_connect(m_pTreeModel, "row-inserted", G_CALLBACK(signalRowInserted), this); + + // tdf#160028 LibreOffice embeds RTL/LTR direction markers in currency strings, which defeats the + // default gtk search mechanism, so switch in our one here + gtk_tree_view_set_search_equal_func(m_pTreeView, search_equal_func, nullptr, nullptr); } virtual void connect_query_tooltip(const Link<const weld::TreeIter&, OUString>& rLink) override |