summaryrefslogtreecommitdiffstats
path: root/vcl/unx/gtk3
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--vcl/unx/gtk3/gtkframe.cxx22
-rw-r--r--vcl/unx/gtk3/gtkinst.cxx38
2 files changed, 54 insertions, 6 deletions
diff --git a/vcl/unx/gtk3/gtkframe.cxx b/vcl/unx/gtk3/gtkframe.cxx
index f996b4359b..8c097c526c 100644
--- a/vcl/unx/gtk3/gtkframe.cxx
+++ b/vcl/unx/gtk3/gtkframe.cxx
@@ -3953,12 +3953,24 @@ void GtkSalFrame::signalRealize(GtkWidget*, gpointer frame)
}
AbsoluteScreenPixelRectangle aFloatRect = FloatingWindow::ImplConvertToAbsPos(pVclParent, pThis->m_aFloatRect);
- if (gdk_window_get_window_type(widget_get_surface(pThis->m_pParent->m_pWindow)) != GDK_WINDOW_TOPLEVEL)
+ switch (gdk_window_get_window_type(widget_get_surface(pThis->m_pParent->m_pWindow)))
{
- // See tdf#152155 for an example
- gtk_coord nX(0), nY(0.0);
- gtk_widget_translate_coordinates(pThis->m_pParent->m_pWindow, widget_get_toplevel(pThis->m_pParent->m_pWindow), 0, 0, &nX, &nY);
- aFloatRect.Move(nX, nY);
+ case GDK_WINDOW_TOPLEVEL:
+ break;
+ case GDK_WINDOW_CHILD:
+ {
+ // See tdf#152155 for an example
+ gtk_coord nX(0), nY(0.0);
+ gtk_widget_translate_coordinates(pThis->m_pParent->m_pWindow, widget_get_toplevel(pThis->m_pParent->m_pWindow), 0, 0, &nX, &nY);
+ aFloatRect.Move(nX, nY);
+ break;
+ }
+ default:
+ {
+ // See tdf#154072 for an example
+ aFloatRect.Move(-pThis->m_pParent->maGeometry.x(), -pThis->m_pParent->maGeometry.y());
+ break;
+ }
}
GdkRectangle rect {static_cast<int>(aFloatRect.Left()), static_cast<int>(aFloatRect.Top()),
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