summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/vcl/weld.hxx3
-rw-r--r--vcl/source/app/salvtables.cxx17
-rw-r--r--vcl/unx/gtk3/gtk3gtkinst.cxx15
3 files changed, 35 insertions, 0 deletions
diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index 3f3689fccc61..7dbe6643491e 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -677,6 +677,9 @@ public:
virtual void set_entry_completion(bool bEnable, bool bCaseSensitive = false) = 0;
virtual void set_entry_placeholder_text(const OUString& rText) = 0;
+ // font size is in points, not pixels, e.g. see Window::[G]etPointFont
+ virtual void set_entry_font(const vcl::Font& rFont) = 0;
+
virtual bool get_popup_shown() const = 0;
void connect_entry_insert_text(const Link<OUString&, bool>& rLink)
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 706a874229e6..febffea547fc 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -5946,6 +5946,8 @@ public:
virtual void set_entry_placeholder_text(const OUString&) override { assert(false); }
+ virtual void set_entry_font(const vcl::Font&) override { assert(false); }
+
virtual ~SalInstanceComboBoxWithoutEdit() override
{
m_xComboBox->SetSelectHdl(Link<ListBox&, void>());
@@ -6061,6 +6063,14 @@ public:
return rSelection.Len();
}
+ virtual void set_entry_font(const vcl::Font& rFont) override
+ {
+ Edit* pEdit = m_xComboBox->GetSubEdit();
+ assert(pEdit);
+ pEdit->SetPointFont(*pEdit, rFont);
+ pEdit->Invalidate();
+ }
+
virtual ~SalInstanceComboBoxWithEdit() override
{
m_xComboBox->SetTextFilter(nullptr);
@@ -6132,6 +6142,13 @@ public:
rEntry.SetAutocompleteHdl(Link<Edit&, void>());
}
+ virtual void set_entry_font(const vcl::Font& rFont) override
+ {
+ Edit& rEntry = m_pEntry->getEntry();
+ rEntry.SetPointFont(rEntry, rFont);
+ rEntry.Invalidate();
+ }
+
virtual void set_entry_placeholder_text(const OUString& rText) override
{
Edit& rEntry = m_pEntry->getEntry();
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 8b644d22d1c5..29d1ad3b0b9f 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -13403,6 +13403,16 @@ public:
gtk_entry_set_placeholder_text(pEntry, rText.toUtf8().getStr());
}
+ virtual void set_entry_font(const vcl::Font& rFont) override
+ {
+ PangoAttrList* pAttrList = create_attr_list(rFont);
+ GtkWidget* pChild = gtk_bin_get_child(GTK_BIN(m_pComboBox));
+ assert(pChild && GTK_IS_ENTRY(pChild));
+ GtkEntry* pEntry = GTK_ENTRY(pChild);
+ gtk_entry_set_attributes(pEntry, pAttrList);
+ pango_attr_list_unref(pAttrList);
+ }
+
virtual void disable_notify_events() override
{
if (GtkEntry* pEntry = get_entry())
@@ -13701,6 +13711,11 @@ public:
m_xEntry->set_placeholder_text(rText);
}
+ virtual void set_entry_font(const vcl::Font& rFont) override
+ {
+ m_xEntry->set_font(rFont);
+ }
+
virtual void grab_focus() override { m_xEntry->grab_focus(); }
virtual void connect_focus_in(const Link<Widget&, void>& rLink) override