[Libreoffice-commits] core.git: include/svx include/vcl svx/source vcl/source

2023-09-04 Thread Samuel Mehrbrodt (via logerrit)
 include/svx/sidebar/AreaPropertyPanelBase.hxx |6 
 include/vcl/EnumContext.hxx   |1 
 svx/source/sidebar/area/AreaPropertyPanelBase.cxx |   27 ++
 vcl/source/window/EnumContext.cxx |5 
 4 files changed, 39 insertions(+)

New commits:
commit d4cebb60c7757086fd737e7a2134326209bd4190
Author: Samuel Mehrbrodt 
AuthorDate: Mon Sep 4 13:17:15 2023 +0200
Commit: Samuel Mehrbrodt 
CommitDate: Mon Sep 4 16:10:41 2023 +0200

tdf#154875 "Use slide background" is only for Impress

Change-Id: I078437a1cff58b868f4db4b482ad2aff335dc965
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156514
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt 

diff --git a/include/svx/sidebar/AreaPropertyPanelBase.hxx 
b/include/svx/sidebar/AreaPropertyPanelBase.hxx
index c2c967a8333b..07a5873acf53 100644
--- a/include/svx/sidebar/AreaPropertyPanelBase.hxx
+++ b/include/svx/sidebar/AreaPropertyPanelBase.hxx
@@ -20,6 +20,7 @@
 #define INCLUDED_SVX_SOURCE_SIDEBAR_AREA_AREAPROPERTYPANELBASE_HXX
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -33,6 +34,7 @@
 #include 
 #include 
 #include 
+#include 
 
 class ToolbarUnoDispatcher;
 class XFillFloatTransparenceItem;
@@ -48,6 +50,7 @@ namespace svx::sidebar {
 
 class SVX_DLLPUBLIC AreaPropertyPanelBase
 :   public PanelLayout,
+public ::sfx2::sidebar::IContextChangeReceiver,
 public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
 {
 public:
@@ -99,9 +102,11 @@ public:
 
 private:
 void Initialize();
+virtual void HandleContextChange(const vcl::EnumContext& rContext) 
override;
 
 protected:
 const css::uno::Reference&  mxFrame;
+vcl::EnumContextmaContext;
 
 sal_uInt16  meLastXFS;
 
@@ -109,6 +114,7 @@ protected:
 sal_Int32   mnLastPosBitmap;
 sal_Int32   mnLastPosPattern;
 sal_uInt16  mnLastTransSolid;
+OUStringmsUseBackgroundText;
 
 basegfx::BGradient  maGradientLinear;
 basegfx::BGradient  maGradientAxial;
diff --git a/include/vcl/EnumContext.hxx b/include/vcl/EnumContext.hxx
index 9d82e72adc9d..b8e02efd1f68 100644
--- a/include/vcl/EnumContext.hxx
+++ b/include/vcl/EnumContext.hxx
@@ -128,6 +128,7 @@ public:
 */
 sal_Int32 GetCombinedContext_DI() const;
 
+Application GetApplication() const;
 Application GetApplication_DI() const;
 
 bool operator == (const EnumContext& rOther) const;
diff --git a/svx/source/sidebar/area/AreaPropertyPanelBase.cxx 
b/svx/source/sidebar/area/AreaPropertyPanelBase.cxx
index 9adff2c65dfd..05f4c100d71c 100644
--- a/svx/source/sidebar/area/AreaPropertyPanelBase.cxx
+++ b/svx/source/sidebar/area/AreaPropertyPanelBase.cxx
@@ -1392,6 +1392,33 @@ basegfx::BColorStops 
AreaPropertyPanelBase::createColorStops()
 return aColorStops;
 }
 
+void AreaPropertyPanelBase::HandleContextChange(
+const vcl::EnumContext& rContext)
+{
+if (maContext.GetApplication() == rContext.GetApplication())
+return;
+
+maContext = rContext;
+
+switch (maContext.GetApplication())
+{
+case vcl::EnumContext::Application::Impress:
+if (!msUseBackgroundText.isEmpty())
+{
+mxLbFillType->insert_text(USE_BACKGROUND, msUseBackgroundText);
+msUseBackgroundText = OUString();
+}
+break;
+default:
+if (msUseBackgroundText.isEmpty())
+{
+msUseBackgroundText = mxLbFillType->get_text(USE_BACKGROUND);
+mxLbFillType->remove(USE_BACKGROUND);
+}
+break;
+}
+}
+
 } // end of namespace svx::sidebar
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/EnumContext.cxx 
b/vcl/source/window/EnumContext.cxx
index 6ca075eb6943..ffe065568282 100644
--- a/vcl/source/window/EnumContext.cxx
+++ b/vcl/source/window/EnumContext.cxx
@@ -60,6 +60,11 @@ sal_Int32 EnumContext::GetCombinedContext_DI() const
 return CombinedEnumContext(GetApplication_DI(), meContext);
 }
 
+EnumContext::Application EnumContext::GetApplication() const
+{
+ return meApplication;
+}
+
 EnumContext::Application EnumContext::GetApplication_DI() const
 {
  switch (meApplication)


[Libreoffice-commits] core.git: include/svx include/vcl svx/source vcl/source

2021-03-06 Thread Noel Grandin (via logerrit)
 include/svx/SvxColorValueSet.hxx |4 +++-
 include/vcl/settings.hxx |4 
 svx/source/tbxctrls/SvxColorValueSet.cxx |5 -
 vcl/source/app/settings.cxx  |6 --
 4 files changed, 3 insertions(+), 16 deletions(-)

New commits:
commit 4474d167e1b69ab9ca8a97c636f0400a5084641a
Author: Noel Grandin 
AuthorDate: Sat Mar 6 08:38:12 2021 +0200
Commit: Noel Grandin 
CommitDate: Sat Mar 6 13:07:58 2021 +0100

drop StyleSettings::GetColorValueSetMaximumRowCount

pull it into the only place it is used.

Change-Id: I5923f1599e033d893cebea606138c53ab2cd02fe
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112045
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/include/svx/SvxColorValueSet.hxx b/include/svx/SvxColorValueSet.hxx
index 82792acf64f4..dd8f93348153 100644
--- a/include/svx/SvxColorValueSet.hxx
+++ b/include/svx/SvxColorValueSet.hxx
@@ -32,7 +32,9 @@ public:
 
 virtual void Resize() override;
 
-static sal_uInt32 getMaxRowCount();
+/* Maximum row/line count for the ColorValueSet control. If more lines 
would be needed, a scrollbar will
+   be used. */
+static constexpr sal_uInt32 getMaxRowCount() { return 10; }
 static sal_uInt32 getEntryEdgeLength();
 static sal_uInt32 getColumnCount();
 
diff --git a/include/vcl/settings.hxx b/include/vcl/settings.hxx
index 1e18e005cb70..38b7d423936c 100644
--- a/include/vcl/settings.hxx
+++ b/include/vcl/settings.hxx
@@ -597,10 +597,6 @@ public:
 voidSetColorValueSetColumnCount(sal_uInt16 
nCount);
 sal_uInt16  GetColorValueSetColumnCount() const;
 
-// maximum row/line count for the ColorValueSet control. If more lines 
would be needed, a scrollbar will
-// be used.
-static sal_uInt16   GetColorValueSetMaximumRowCount();
-
 voidSetListBoxPreviewDefaultLogicSize(Size 
const & rSize);
 const Size& GetListBoxPreviewDefaultPixelSize() const;
 
diff --git a/svx/source/tbxctrls/SvxColorValueSet.cxx 
b/svx/source/tbxctrls/SvxColorValueSet.cxx
index e349083e34aa..9176c00a2a8d 100644
--- a/svx/source/tbxctrls/SvxColorValueSet.cxx
+++ b/svx/source/tbxctrls/SvxColorValueSet.cxx
@@ -36,11 +36,6 @@ FactoryFunction SvxColorValueSet::GetUITestFactory() const
 return SvxColorValueSetUIObject::create;
 }
 
-sal_uInt32 SvxColorValueSet::getMaxRowCount()
-{
-return StyleSettings::GetColorValueSetMaximumRowCount();
-}
-
 sal_uInt32 SvxColorValueSet::getEntryEdgeLength()
 {
 const StyleSettings& rStyleSettings = 
Application::GetSettings().GetStyleSettings();
diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx
index bfce93a9736b..66a285288242 100644
--- a/vcl/source/app/settings.cxx
+++ b/vcl/source/app/settings.cxx
@@ -2136,12 +2136,6 @@ StyleSettings::GetColorValueSetColumnCount() const
 return mxData->mnColorValueSetColumnCount;
 }
 
-sal_uInt16
-StyleSettings::GetColorValueSetMaximumRowCount()
-{
-return 10;
-}
-
 sal_uInt16
 StyleSettings::GetListBoxPreviewDefaultLineWidth()
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/svx include/vcl svx/source vcl/source

2020-11-26 Thread Caolán McNamara (via logerrit)
 include/svx/gridctrl.hxx   |   11 +--
 include/vcl/weldutils.hxx  |   19 
 svx/source/fmcomp/gridctrl.cxx |   62 ++---
 vcl/source/app/weldutils.cxx   |   40 ++
 4 files changed, 65 insertions(+), 67 deletions(-)

New commits:
commit 952242a20cdc4a0248a95c1e1d61b1c213ae270a
Author: Caolán McNamara 
AuthorDate: Wed Nov 25 12:13:14 2020 +
Commit: Caolán McNamara 
CommitDate: Thu Nov 26 15:06:35 2020 +0100

factor out as a standalone "ButtonPressRepeater" class

Change-Id: Id89d5655c2428cecdaf9faa224133302c6448a87
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106600
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/include/svx/gridctrl.hxx b/include/svx/gridctrl.hxx
index 1fb6c19951b6..d5d15d0054e4 100644
--- a/include/svx/gridctrl.hxx
+++ b/include/svx/gridctrl.hxx
@@ -190,8 +190,8 @@ class NavigationBar final : public InterimItemWindow
 std::unique_ptr m_xLastBtn; // Button for 'go to the 
last record'
 std::unique_ptr m_xNewBtn;  // Button for 'go to a 
new record'
 
-AutoTimer m_aNextRepeat;
-AutoTimer m_aPrevRepeat;
+weld::ButtonPressRepeater m_aPrevRepeater;
+weld::ButtonPressRepeater m_aNextRepeater;
 
 sal_Int32m_nCurrentPos;
 
@@ -213,13 +213,6 @@ private:
 
 DECL_LINK(OnClick, weld::Button&, void);
 
-DECL_LINK(PrevMousePressHdl, const MouseEvent&, bool);
-DECL_LINK(PrevMouseReleaseHdl, const MouseEvent&, bool);
-DECL_LINK(NextMousePressHdl, const MouseEvent&, bool);
-DECL_LINK(NextMouseReleaseHdl, const MouseEvent&, bool);
-DECL_LINK(PrevRepeatTimerHdl, Timer*, void);
-DECL_LINK(NextRepeatTimerHdl, Timer*, void);
-
 void PositionDataSource(sal_Int32 nRecord);
 };
 
diff --git a/include/vcl/weldutils.hxx b/include/vcl/weldutils.hxx
index 9a29e89d7b5f..d956849a3292 100644
--- a/include/vcl/weldutils.hxx
+++ b/include/vcl/weldutils.hxx
@@ -20,6 +20,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 class CalendarWrapper;
@@ -390,6 +391,24 @@ private:
 DECL_DLLPRIVATE_LINK(KeyInputHdl, const KeyEvent&, bool);
 };
 
+class VCL_DLLPUBLIC ButtonPressRepeater final
+{
+private:
+weld::Button& m_rButton;
+AutoTimer m_aRepeat;
+const Link m_aLink;
+bool m_bModKey;
+
+DECL_LINK(MousePressHdl, const MouseEvent&, bool);
+DECL_LINK(MouseReleaseHdl, const MouseEvent&, bool);
+DECL_LINK(RepeatTimerHdl, Timer*, void);
+
+public:
+ButtonPressRepeater(weld::Button& rButton, const Link& 
rLink);
+void Stop() { m_aRepeat.Stop(); }
+bool IsModKeyPressed() const { return m_bModKey; }
+};
+
 // get the row the iterator is on
 VCL_DLLPUBLIC size_t GetAbsPos(const weld::TreeView& rTreeView, const 
weld::TreeIter& rIter);
 
diff --git a/svx/source/fmcomp/gridctrl.cxx b/svx/source/fmcomp/gridctrl.cxx
index c5eb6ba50ac6..b004aed7d7d9 100644
--- a/svx/source/fmcomp/gridctrl.cxx
+++ b/svx/source/fmcomp/gridctrl.cxx
@@ -317,6 +317,8 @@ NavigationBar::NavigationBar(vcl::Window* pParent)
 , m_xNextBtn(m_xBuilder->weld_button("next"))
 , m_xLastBtn(m_xBuilder->weld_button("last"))
 , m_xNewBtn(m_xBuilder->weld_button("new"))
+, m_aPrevRepeater(*m_xPrevBtn, LINK(this,NavigationBar,OnClick))
+, m_aNextRepeater(*m_xNextBtn, LINK(this,NavigationBar,OnClick))
 , m_nCurrentPos(-1)
 , m_bPositioning(false)
 {
@@ -340,19 +342,6 @@ NavigationBar::NavigationBar(vcl::Window* pParent)
 m_xLastBtn->connect_clicked(LINK(this,NavigationBar,OnClick));
 m_xNewBtn->connect_clicked(LINK(this,NavigationBar,OnClick));
 
-// instead of connect_clicked because we want a button held down to
-// repeat the next/prev
-m_xPrevBtn->connect_mouse_press(LINK(this, NavigationBar, 
PrevMousePressHdl));
-m_xNextBtn->connect_mouse_press(LINK(this, NavigationBar, 
NextMousePressHdl));
-m_xPrevBtn->connect_mouse_release(LINK(this, NavigationBar, 
PrevMouseReleaseHdl));
-m_xNextBtn->connect_mouse_release(LINK(this, NavigationBar, 
NextMouseReleaseHdl));
-
-auto nRepeatTime = 
Application::GetSettings().GetMouseSettings().GetButtonRepeat();
-m_aNextRepeat.SetTimeout(nRepeatTime);
-m_aNextRepeat.SetInvokeHandler(LINK(this, NavigationBar, 
NextRepeatTimerHdl));
-m_aPrevRepeat.SetTimeout(nRepeatTime);
-m_aPrevRepeat.SetInvokeHandler(LINK(this, NavigationBar, 
PrevRepeatTimerHdl));
-
 m_xRecordText->set_label(SvxResId(RID_STR_REC_TEXT));
 m_xRecordOf->set_label(SvxResId(RID_STR_REC_FROM_TEXT));
 m_xRecordCount->set_label(OUString('?'));
@@ -386,49 +375,6 @@ sal_uInt16 NavigationBar::ArrangeControls()
 return m_xContainer->get_preferred_size().Width();
 }
 
-IMPL_LINK_NOARG(NavigationBar, PrevRepeatTimerHdl, Timer*, void)
-{
-OnClick(*m_xPrevBtn);
-}
-
-IMPL_LINK_NOARG(NavigationBar, NextRepeatTimerHdl, Timer*, void)
-{
-OnClick(*m_xNextBtn);
-}
-
-IMPL_LINK_NOARG(NavigationBar, 

[Libreoffice-commits] core.git: include/svx include/vcl svx/source vcl/source vcl/unx

2018-05-03 Thread Caolán McNamara
 include/svx/dlgctrl.hxx   |1 +
 include/vcl/weld.hxx  |5 +
 svx/source/dialog/dlgctrl.cxx |   13 -
 vcl/source/app/salvtables.cxx |3 +++
 vcl/unx/gtk3/gtk3gtkinst.cxx  |7 +++
 5 files changed, 24 insertions(+), 5 deletions(-)

New commits:
commit 2d45f87330ef7011711767cc736829e4082b236b
Author: Caolán McNamara 
Date:   Wed May 2 21:21:36 2018 +0100

support native focus for drawing sub region

Change-Id: I9862f060b9d5b2c3015c084060887f2d66f1ed01
Reviewed-on: https://gerrit.libreoffice.org/53768
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/include/svx/dlgctrl.hxx b/include/svx/dlgctrl.hxx
index 075a008fe0c0..1f2a17f9feb7 100644
--- a/include/svx/dlgctrl.hxx
+++ b/include/svx/dlgctrl.hxx
@@ -194,6 +194,7 @@ public:
 DECL_LINK(DoGetFocus, weld::Widget&, void);
 DECL_LINK(DoLoseFocus, weld::Widget&, void);
 DECL_LINK(MarkToResetSettings, weld::Widget&, void);
+DECL_LINK(DoFocusRect, weld::Widget&, tools::Rectangle);
 
 voidReset();
 RectPoint   GetActualRP() const { return eRP;}
diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index 309c1447a80d..9e58e585a533 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -701,6 +701,7 @@ protected:
 Link m_aKeyPressHdl;
 Link m_aKeyReleaseHdl;
 Link m_aStyleUpdatedHdl;
+Link m_aGetFocusRectHdl;
 
 public:
 void connect_draw(const Link& rLink) { m_aDrawHdl = 
rLink; }
@@ -720,6 +721,10 @@ public:
 void connect_key_press(const Link& rLink) { 
m_aKeyPressHdl = rLink; }
 void connect_key_release(const Link& rLink) { 
m_aKeyReleaseHdl = rLink; }
 void connect_style_updated(const Link& rLink) { 
m_aStyleUpdatedHdl = rLink; }
+void connect_focus_rect(const Link& rLink)
+{
+m_aGetFocusRectHdl = rLink;
+}
 virtual void queue_draw() = 0;
 virtual void queue_draw_area(int x, int y, int width, int height) = 0;
 virtual a11yref get_accessible_parent() = 0;
diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx
index a4d31925d242..d091a121023d 100644
--- a/svx/source/dialog/dlgctrl.cxx
+++ b/svx/source/dialog/dlgctrl.cxx
@@ -684,6 +684,7 @@ RectCtl::RectCtl(weld::Builder& rBuilder, const OString& 
rDrawingId, SvxTabPage*
 m_xControl->connect_key_press(LINK(this, RectCtl, DoKeyDown));
 m_xControl->connect_focus_in(LINK(this, RectCtl, DoGetFocus));
 m_xControl->connect_focus_out(LINK(this, RectCtl, DoLoseFocus));
+m_xControl->connect_focus_rect(LINK(this, RectCtl, DoFocusRect));
 
 m_xControl->set_size_request(m_xControl->get_approximate_digit_width() * 
25, m_xControl->get_text_height() * 5);
 Resize_Impl();
@@ -976,12 +977,14 @@ IMPL_LINK(RectCtl, DoPaint, weld::DrawingArea::draw_args, 
aPayload, void)
 rRenderContext.DrawBitmap(aCenterPt, aDstBtnSize, aBtnPnt2, 
aBtnSize, rBitmap.GetBitmap());
 }
 }
+}
 
-if (m_xControl->has_focus())
-{
-tools::Rectangle aFocusRect(CalculateFocusRectangle());
-rRenderContext.Invert(aFocusRect, InvertFlags(0x));
-}
+IMPL_LINK(RectCtl, DoFocusRect, weld::Widget&, rControl, tools::Rectangle)
+{
+tools::Rectangle aRet;
+if (rControl.has_focus())
+aRet = CalculateFocusRectangle();
+return aRet;
 }
 
 // Convert RectPoint Point
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 8af07394c310..818ef8b778b4 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -1683,6 +1683,9 @@ public:
 IMPL_LINK(SalInstanceDrawingArea, PaintHdl, target_and_area, aPayload, void)
 {
 m_aDrawHdl.Call(aPayload);
+tools::Rectangle aFocusRect(m_aGetFocusRectHdl.Call(*this));
+if (!aFocusRect.IsEmpty())
+aPayload.first.Invert(aFocusRect, InvertFlags(0x));
 }
 
 IMPL_LINK(SalInstanceDrawingArea, ResizeHdl, const Size&, rSize, void)
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index b33013916a85..ed78e141b124 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -3506,6 +3506,13 @@ private:
 
 cairo_set_source_surface(cr, m_pSurface, 0, 0);
 cairo_paint(cr);
+
+tools::Rectangle aFocusRect(m_aGetFocusRectHdl.Call(*this));
+if (!aFocusRect.IsEmpty())
+{
+
gtk_render_focus(gtk_widget_get_style_context(GTK_WIDGET(m_pDrawingArea)), cr,
+ aFocusRect.Left(), aFocusRect.Top(), 
aFocusRect.GetWidth(), aFocusRect.GetHeight());
+}
 }
 static void signalSizeAllocate(GtkWidget*, GdkRectangle* allocation, 
gpointer widget)
 {
___
Libreoffice-commits mailing list

[Libreoffice-commits] core.git: include/svx include/vcl svx/source vcl/source

2015-07-03 Thread László Németh
 include/svx/charmap.hxx   |3 +++
 include/vcl/ctrl.hxx  |2 ++
 svx/source/dialog/charmap.cxx |   19 ++-
 vcl/source/control/ctrl.cxx   |   21 +++--
 4 files changed, 38 insertions(+), 7 deletions(-)

New commits:
commit b010e4074e5d5ee3a3905f1351f04efafe937c2a
Author: László Németh laszlo.nem...@collabora.com
Date:   Fri Jul 3 18:50:05 2015 +0200

tdf#92241 fix crashes and rendering of symbol set previews

Change-Id: I43397f2b0caa31c334f87acf11fc96df2e051ad8

diff --git a/include/svx/charmap.hxx b/include/svx/charmap.hxx
index d50382e..e56fe98 100644
--- a/include/svx/charmap.hxx
+++ b/include/svx/charmap.hxx
@@ -58,6 +58,7 @@ public:
 Link  GetPreSelectHdl() const { return aHighHdl; }
 voidSetPreSelectHdl( const Link rHdl ) { aPreSelectHdl = 
rHdl; }
 static sal_uInt32 getSelectedChar();
+voidSetFont( const vcl::Font rFont );
 
 svx::SvxShowCharSetItem*  ImplGetItem( int _nPos );
 int FirstInView() const;
@@ -108,12 +109,14 @@ private:
 sal_Int32   nSelectedIndex;
 
 FontCharMapPtr  mpFontCharMap;
+SizemaFontSize;
 VclPtrScrollBar  aVscrollSB;
 
 bool mbRecalculateFont  : 1;
 bool mbUpdateForeground : 1;
 bool mbUpdateBackground : 1;
 
+
 private:
 voidDrawChars_Impl(vcl::RenderContext rRenderContext, int n1, 
int n2);
 voidInitSettings(vcl::RenderContext rRenderContext);
diff --git a/include/vcl/ctrl.hxx b/include/vcl/ctrl.hxx
index 6741a22..69a3569 100644
--- a/include/vcl/ctrl.hxx
+++ b/include/vcl/ctrl.hxx
@@ -41,6 +41,8 @@ protected:
 
 private:
 boolmbHasControlFocus;
+boolmbFont;
+boolmbForeground;
 Link  maGetFocusHdl;
 Link  maLoseFocusHdl;
 
diff --git a/svx/source/dialog/charmap.cxx b/svx/source/dialog/charmap.cxx
index 9d0c9a5..f5e9595 100644
--- a/svx/source/dialog/charmap.cxx
+++ b/svx/source/dialog/charmap.cxx
@@ -57,6 +57,7 @@ sal_uInt32 SvxShowCharSet::getSelectedChar()
 SvxShowCharSet::SvxShowCharSet(vcl::Window* pParent)
 : Control(pParent, WB_TABSTOP | WB_BORDER)
 , m_pAccessible(nullptr)
+, maFontSize(0, 0)
 , aVscrollSB( VclPtrScrollBar::Create(this, WB_VERT) )
 , mbRecalculateFont(true)
 , mbUpdateForeground(true)
@@ -114,6 +115,7 @@ void SvxShowCharSet::StateChanged(StateChangedType nType)
 Invalidate();
 
 Control::StateChanged( nType );
+
 }
 
 
@@ -331,6 +333,12 @@ void SvxShowCharSet::Paint( vcl::RenderContext 
rRenderContext, const Rectangle
 DrawChars_Impl(rRenderContext, FirstInView(), LastInView());
 }
 
+void SvxShowCharSet::SetFont( const vcl::Font rFont )
+{
+Control::SetFont(rFont);
+Invalidate();
+}
+
 void SvxShowCharSet::DeSelect()
 {
 Invalidate();
@@ -506,6 +514,14 @@ void SvxShowCharSet::InitSettings(vcl::RenderContext 
rRenderContext)
 
 mbUpdateBackground = false;
 }
+
+vcl::Font aFont(rRenderContext.GetFont());
+aFont.SetWeight(WEIGHT_LIGHT);
+aFont.SetAlign(ALIGN_TOP);
+aFont.SetSize(maFontSize);
+aFont.SetTransparent(true);
+rRenderContext.SetFont(aFont);
+
 }
 
 
@@ -536,7 +552,8 @@ void SvxShowCharSet::RecalculateFont(vcl::RenderContext 
rRenderContext)
 aFont.SetWeight(WEIGHT_LIGHT);
 aFont.SetAlign(ALIGN_TOP);
 int nFontHeight = (aSize.Height() - 5) * 2 / (3 * ROW_COUNT);
-aFont.SetSize(rRenderContext.PixelToLogic(Size(0, nFontHeight)));
+maFontSize = rRenderContext.PixelToLogic(Size(0, nFontHeight));
+aFont.SetSize(maFontSize);
 aFont.SetTransparent(true);
 rRenderContext.SetFont(aFont);
 rRenderContext.GetFontCharMap(mpFontCharMap);
diff --git a/vcl/source/control/ctrl.cxx b/vcl/source/control/ctrl.cxx
index 0c40a34..21056db 100644
--- a/vcl/source/control/ctrl.cxx
+++ b/vcl/source/control/ctrl.cxx
@@ -36,6 +36,8 @@ using namespace vcl;
 void Control::ImplInitControlData()
 {
 mbHasControlFocus   = false;
+mbFont  = false;
+mbForeground= false;
 mpControlData   = new ImplControlData;
 }
 
@@ -417,16 +419,23 @@ void Control::ApplySettings(vcl::RenderContext 
rRenderContext)
 {
 const StyleSettings rStyleSettings = 
rRenderContext.GetSettings().GetStyleSettings();
 
-vcl::Font rFont(GetCanonicalFont(rStyleSettings));
-ApplyControlFont(rRenderContext, rFont);
-
-ApplyControlForeground(rRenderContext, 
GetCanonicalTextColor(rStyleSettings));
+if (mbFont)
+{
+vcl::Font rFont(GetCanonicalFont(rStyleSettings));
+ApplyControlFont(rRenderContext, rFont);
+}
 
-rRenderContext.SetTextFillColor();
+if (mbFont || mbForeground)
+{
+ApplyControlForeground(rRenderContext, 
GetCanonicalTextColor(rStyleSettings));
+rRenderContext.SetTextFillColor();
+}
 }
 
-void Control::ImplInitSettings(const bool, 

[Libreoffice-commits] core.git: include/svx include/vcl svx/source vcl/source

2014-09-30 Thread Samuel Mehrbrodt
 include/svx/dialogs.hrc  |2 +-
 include/vcl/menubtn.hxx  |3 ++-
 svx/source/tbxctrls/tbcontrl.cxx |   32 ++--
 svx/source/tbxctrls/tbcontrl.src |8 
 vcl/source/control/menubtn.cxx   |   10 +-
 5 files changed, 26 insertions(+), 29 deletions(-)

New commits:
commit d59e33500a250824e713afacef2ea295576caba6
Author: Samuel Mehrbrodt s.mehrbr...@gmail.com
Date:   Tue Sep 30 20:37:12 2014 +0200

fdo#62081 Improve split menu on style dropdown

* Remove Apply style
* Add Update Style Based on Selection
* A11y:
  * Context menu key: Open submenu
  * Return key: Apply style

Change-Id: Ib2960baa1412a05ea00b0e214d1af0a3d119e852

diff --git a/include/svx/dialogs.hrc b/include/svx/dialogs.hrc
index 65e8087..d96bacb 100644
--- a/include/svx/dialogs.hrc
+++ b/include/svx/dialogs.hrc
@@ -185,7 +185,7 @@
 // for Toolbox-Control style
 #define RID_SVXTBX_STYLE(RID_SVX_START + 120)
 #define RID_SVX_STYLE_MENU  (RID_SVX_START + 121)
-#define RID_SVX_APPLY_STYLE (RID_SVX_START + 122)
+#define RID_SVX_UPDATE_STYLE(RID_SVX_START + 122)
 #define RID_SVX_MODIFY_STYLE(RID_SVX_START + 123)
 
 #define RID_SVXDLG_COMPRESSGRAPHICS (RID_SVX_START + 142)
diff --git a/include/vcl/menubtn.hxx b/include/vcl/menubtn.hxx
index 78209c8..83087ab 100644
--- a/include/vcl/menubtn.hxx
+++ b/include/vcl/menubtn.hxx
@@ -45,7 +45,6 @@ private:
 LinkmaSelectHdl;
 
 SAL_DLLPRIVATE voidImplInitMenuButtonData();
-SAL_DLLPRIVATE voidImplExecuteMenu();
 DECL_DLLPRIVATE_LINK(  ImplMenuTimeoutHdl, void* );
 
 // Copy assignment is forbidden and not implemented.
@@ -66,6 +65,8 @@ public:
 virtual voidActivate() SAL_OVERRIDE;
 virtual voidSelect();
 
+voidExecuteMenu();
+
 voidSetMenuMode( sal_uInt16 nMode );
 sal_uInt16  GetMenuMode() const { return mnMenuMode; }
 
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 8ca31d8..fe8597d 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -345,24 +345,24 @@ void SvxStyleBox_Impl::ReleaseFocus()
 
 IMPL_LINK( SvxStyleBox_Impl, MenuSelectHdl, Menu*, pMenu)
 {
+ReleaseFocus();
+OUString sEntry = OUString( (GetEntry(GetSelectEntryPos())) );
+Sequence PropertyValue  aArgs( 2 );
+aArgs[0].Name   = Param;
+aArgs[0].Value  = makeAny( sEntry );
+aArgs[1].Name   = Family;
+aArgs[1].Value  = makeAny( sal_Int16( eStyleFamily ));
+
 sal_uInt16 nMenuId = pMenu-GetCurItemId();
 switch(nMenuId) {
-case RID_SVX_APPLY_STYLE:
+case RID_SVX_UPDATE_STYLE:
 {
-nCurSel = GetSelectEntryPos();
-SetText(GetEntry(nCurSel));
-Select();
+SfxToolBoxControl::Dispatch( m_xDispatchProvider,
+OUString( .uno:StyleUpdateByExample ), aArgs );
 break;
 }
 case RID_SVX_MODIFY_STYLE:
 {
-OUString sEntry = OUString( (GetEntry(GetSelectEntryPos())) );
-ReleaseFocus();
-Sequence PropertyValue  aArgs( 2 );
-aArgs[0].Name   = Param;
-aArgs[0].Value  = makeAny( sEntry );
-aArgs[1].Name   = Family;
-aArgs[1].Value  = makeAny( sal_Int16( eStyleFamily ));
 SfxToolBoxControl::Dispatch( m_xDispatchProvider,
 OUString( .uno:EditStyle ), aArgs );
 break;
@@ -484,22 +484,18 @@ bool SvxStyleBox_Impl::Notify( NotifyEvent rNEvt )
 
 switch ( nCode )
 {
-case KEY_RETURN:
+case KEY_CONTEXTMENU:
 {
 if(IsInDropDown())
 {
 sal_uInt16 nItem = GetSelectEntryPos() - 1;
 if(nItem  MAX_STYLES_ENTRIES)
-m_pButtons[nItem]-KeyInput(*rNEvt.GetKeyEvent());
-nHandled = true;
-}
-else
-{
+m_pButtons[nItem]-ExecuteMenu();
 nHandled = true;
-Select();
 }
 break;
 }
+case KEY_RETURN:
 case KEY_TAB:
 {
 if ( KEY_TAB == nCode )
diff --git a/svx/source/tbxctrls/tbcontrl.src b/svx/source/tbxctrls/tbcontrl.src
index 59728c6..df42dca 100644
--- a/svx/source/tbxctrls/tbcontrl.src
+++ b/svx/source/tbxctrls/tbcontrl.src
@@ -79,7 +79,7 @@ String RID_SVXSTR_LINECOLOR
 ComboBox RID_SVXTBX_STYLE
 {
 HelpId = HID_STYLE_LISTBOX ;
-Size = MAP_APPFONT ( 50 , 86 ) ;
+Size = MAP_APPFONT ( 60 , 86 ) ;
 DropDown = TRUE ;
 Sort = TRUE ;
 AutoHScroll = TRUE ;
@@ -94,13 +94,13 @@ Menu RID_SVX_STYLE_MENU
 {
 MenuItem
 {
-Identifier =