[Libreoffice-commits] core.git: icon-themes/breeze icon-themes/colibre icon-themes/colibre_svg include/svx svx/inc svx/source sw/source

Jim Raykowski (via logerrit) logerrit at kemper.freedesktop.org
Sat Mar 27 08:02:10 UTC 2021


 icon-themes/breeze/svx/res/adding-selection_10x22.png         |binary
 icon-themes/breeze/svx/res/block-selection_10x22.png          |binary
 icon-themes/breeze/svx/res/extending-selection_10x22.png      |binary
 icon-themes/breeze/svx/res/standard-selection_10x22.png       |binary
 icon-themes/colibre/svx/res/adding-selection_10x22.png        |binary
 icon-themes/colibre/svx/res/block-selection_10x22.png         |binary
 icon-themes/colibre/svx/res/extending-selection_10x22.png     |binary
 icon-themes/colibre/svx/res/standard-selection_10x22.png      |binary
 icon-themes/colibre_svg/svx/res/adding-selection_10x22.svg    |    1 
 icon-themes/colibre_svg/svx/res/block-selection_10x22.svg     |    1 
 icon-themes/colibre_svg/svx/res/extending-selection_10x22.svg |    1 
 icon-themes/colibre_svg/svx/res/standard-selection_10x22.svg  |    1 
 include/svx/selctrl.hxx                                       |    3 -
 include/svx/strings.hrc                                       |    1 
 svx/inc/bitmaps.hlst                                          |    5 +
 svx/source/stbctrls/selctrl.cxx                               |   27 +++++++---
 sw/source/uibase/uiview/view2.cxx                             |   18 ------
 17 files changed, 31 insertions(+), 27 deletions(-)

New commits:
commit e18b743a840475cfbdfba437a1edf8677a5f93bd
Author:     Jim Raykowski <raykowj at gmail.com>
AuthorDate: Thu Mar 11 10:31:46 2021 -0900
Commit:     Jim Raykowski <raykowj at gmail.com>
CommitDate: Sat Mar 27 09:01:30 2021 +0100

    tdf#140936 statusbar selection mode control improvements
    
    - shows different image for each selection mode
    - tooltip indicates the current selection mode and mouse click hint
    - replaces left-click cycle selection mode with context menu popup
    
    Change-Id: Ieb2662de99cf42d4ada4c1a590bebc8363861c7b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112367
    Tested-by: Jenkins
    Reviewed-by: Rizal Muttaqin <rizmut at libreoffice.org>

diff --git a/icon-themes/breeze/svx/res/adding-selection_10x22.png b/icon-themes/breeze/svx/res/adding-selection_10x22.png
new file mode 100644
index 000000000000..3585193c01d1
Binary files /dev/null and b/icon-themes/breeze/svx/res/adding-selection_10x22.png differ
diff --git a/icon-themes/breeze/svx/res/block-selection_10x22.png b/icon-themes/breeze/svx/res/block-selection_10x22.png
new file mode 100644
index 000000000000..4c12110e49e7
Binary files /dev/null and b/icon-themes/breeze/svx/res/block-selection_10x22.png differ
diff --git a/icon-themes/breeze/svx/res/extending-selection_10x22.png b/icon-themes/breeze/svx/res/extending-selection_10x22.png
new file mode 100644
index 000000000000..22a24cfee3f6
Binary files /dev/null and b/icon-themes/breeze/svx/res/extending-selection_10x22.png differ
diff --git a/icon-themes/breeze/svx/res/standard-selection_10x22.png b/icon-themes/breeze/svx/res/standard-selection_10x22.png
new file mode 100644
index 000000000000..bff93beab4e1
Binary files /dev/null and b/icon-themes/breeze/svx/res/standard-selection_10x22.png differ
diff --git a/icon-themes/colibre/svx/res/adding-selection_10x22.png b/icon-themes/colibre/svx/res/adding-selection_10x22.png
new file mode 100644
index 000000000000..5e9ea9846ab0
Binary files /dev/null and b/icon-themes/colibre/svx/res/adding-selection_10x22.png differ
diff --git a/icon-themes/colibre/svx/res/block-selection_10x22.png b/icon-themes/colibre/svx/res/block-selection_10x22.png
new file mode 100644
index 000000000000..d244daea3f09
Binary files /dev/null and b/icon-themes/colibre/svx/res/block-selection_10x22.png differ
diff --git a/icon-themes/colibre/svx/res/extending-selection_10x22.png b/icon-themes/colibre/svx/res/extending-selection_10x22.png
new file mode 100644
index 000000000000..2046a8ff550c
Binary files /dev/null and b/icon-themes/colibre/svx/res/extending-selection_10x22.png differ
diff --git a/icon-themes/colibre/svx/res/standard-selection_10x22.png b/icon-themes/colibre/svx/res/standard-selection_10x22.png
new file mode 100644
index 000000000000..051194b20b42
Binary files /dev/null and b/icon-themes/colibre/svx/res/standard-selection_10x22.png differ
diff --git a/icon-themes/colibre_svg/svx/res/adding-selection_10x22.svg b/icon-themes/colibre_svg/svx/res/adding-selection_10x22.svg
new file mode 100644
index 000000000000..61f25cf47958
--- /dev/null
+++ b/icon-themes/colibre_svg/svx/res/adding-selection_10x22.svg
@@ -0,0 +1 @@
+<svg viewBox="0 0 22 10" xmlns="http://www.w3.org/2000/svg"><path d="m14 0v1h2v8h-2v1h5v-1h-2v-8h2v-1z" fill="#3a3a38"/><g fill="#1e8bcd"><path d="m8 2v6h-5v-6zm-1 1h-3v4h3z"/><path d="m14 2v6h-5v-6zm-1 1h-3v4h3z"/></g></svg>
\ No newline at end of file
diff --git a/icon-themes/colibre_svg/svx/res/block-selection_10x22.svg b/icon-themes/colibre_svg/svx/res/block-selection_10x22.svg
new file mode 100644
index 000000000000..24430c67b6e2
--- /dev/null
+++ b/icon-themes/colibre_svg/svx/res/block-selection_10x22.svg
@@ -0,0 +1 @@
+<svg viewBox="0 0 22 10" xmlns="http://www.w3.org/2000/svg"><path d="m14 0v1h2v8h-2v1h5v-1h-2v-8h2v-1z" fill="#3a3a38"/><path d="m12 2v6h-9v-6z" fill="#1e8bcd"/></svg>
\ No newline at end of file
diff --git a/icon-themes/colibre_svg/svx/res/extending-selection_10x22.svg b/icon-themes/colibre_svg/svx/res/extending-selection_10x22.svg
new file mode 100644
index 000000000000..5a8b38b91b6e
--- /dev/null
+++ b/icon-themes/colibre_svg/svx/res/extending-selection_10x22.svg
@@ -0,0 +1 @@
+<svg viewBox="0 0 22 10" xmlns="http://www.w3.org/2000/svg"><path d="m14 0v1h2v8h-2v1h5v-1h-2v-8h2v-1z" fill="#3a3a38"/><g fill="#1e8bcd"><path d="m11 2v6h-5v-6zm-1 1h-3v4h3z"/><path d="m12 2 3.5 3-3.5 3v-1.5l1.750616-1.5-1.750616-1.5z"/><path d="m5 2-3.5 3 3.5 3v-1.5l-1.750616-1.5 1.750616-1.5z"/></g></svg>
\ No newline at end of file
diff --git a/icon-themes/colibre_svg/svx/res/standard-selection_10x22.svg b/icon-themes/colibre_svg/svx/res/standard-selection_10x22.svg
new file mode 100644
index 000000000000..9eb87700c5d3
--- /dev/null
+++ b/icon-themes/colibre_svg/svx/res/standard-selection_10x22.svg
@@ -0,0 +1 @@
+<svg viewBox="0 0 22 10" xmlns="http://www.w3.org/2000/svg"><path d="m14 0v1h2v8h-2v1h5v-1h-2v-8h2v-1z" fill="#3a3a38"/><path d="m12 2v6h-9v-6zm-1 1h-7v4h7z" fill="#1e8bcd"/></svg>
\ No newline at end of file
diff --git a/include/svx/selctrl.hxx b/include/svx/selctrl.hxx
index 75d7f8cc3a84..4deea5880901 100644
--- a/include/svx/selctrl.hxx
+++ b/include/svx/selctrl.hxx
@@ -35,10 +35,11 @@ public:
                               const SfxPoolItem* pState) override;
     virtual bool MouseButtonDown(const MouseEvent& rEvt) override;
     virtual void Paint(const UserDrawEvent& rEvt) override;
+    virtual void Click() override;
 
 private:
     sal_uInt16 mnState;
-    Image maImage;
+    Image maImages[4];
     bool mbFeatureEnabled;
 };
 
diff --git a/include/svx/strings.hrc b/include/svx/strings.hrc
index 3a307cdc6a36..466c276b0d7c 100644
--- a/include/svx/strings.hrc
+++ b/include/svx/strings.hrc
@@ -1289,6 +1289,7 @@
 // To be shown in the status bar when in overwrite mode, please try to make it not longer than the word 'Overwrite'.
 #define RID_SVXSTR_OVERWRITE_TEXT                           NC_("RID_SVXSTR_OVERWRITE_TEXT", "Overwrite")
 #define RID_SVXSTR_INSERT_TEXT                              NC_("RID_SVXSTR_INSERT_TEXT", "Insert")
+#define RID_SVXSTR_SELECTIONMODE_HELPTEXT                   NC_("RID_SVXSTR_SELECTIONMODE_HELPTEXT", "%1. Click to change selection mode.")
 #define RID_SVXSTR_XMLSEC_SIG_OK                            NC_("RID_SVXSTR_XMLSEC_SIG_OK", "Digital Signature: The document signature is OK.")
 #define RID_SVXSTR_XMLSEC_SIG_OK_NO_VERIFY                  NC_("RID_SVXSTR_XMLSEC_SIG_OK_NO_VERIFY", "Digital Signature: The document signature is OK, but the certificates could not be validated.")
 #define RID_SVXSTR_XMLSEC_SIG_NOT_OK                        NC_("RID_SVXSTR_XMLSEC_SIG_NOT_OK", "Digital Signature: The document signature does not match the document content. We strongly recommend you not to trust this document.")
diff --git a/svx/inc/bitmaps.hlst b/svx/inc/bitmaps.hlst
index 684dba8772f4..3bf954339846 100644
--- a/svx/inc/bitmaps.hlst
+++ b/svx/inc/bitmaps.hlst
@@ -145,7 +145,10 @@
 #define BMP_SQUARE                                  "svx/res/symphony/Square.png"
 #define BMP_LINEAR                                  "svx/res/symphony/linear.png"
 
-#define RID_SVXBMP_SELECTION                        "svx/res/selection_10x22.png"
+#define RID_SVXBMP_STANDARD_SELECTION               "svx/res/standard-selection_10x22.png"
+#define RID_SVXBMP_EXTENDING_SELECTION              "svx/res/extending-selection_10x22.png"
+#define RID_SVXBMP_ADDING_SELECTION                 "svx/res/adding-selection_10x22.png"
+#define RID_SVXBMP_BLOCK_SELECTION                  "svx/res/block-selection_10x22.png"
 #define RID_SVXBMP_POSITION                         "res/sc10223.png"
 #define RID_SVXBMP_SIZE                             "res/sc10224.png"
 #define RID_SVXBMP_SIGNET                           "svx/res/signet_11x16.png"
diff --git a/svx/source/stbctrls/selctrl.cxx b/svx/source/stbctrls/selctrl.cxx
index 845df5a5d367..6e56e22f8d2f 100644
--- a/svx/source/stbctrls/selctrl.cxx
+++ b/svx/source/stbctrls/selctrl.cxx
@@ -36,6 +36,9 @@
 #include <com/sun/star/frame/XFrame.hpp>
 #include <com/sun/star/lang/XServiceInfo.hpp>
 
+#include <svx/strings.hrc>
+#include <svx/dialmgr.hxx>
+
 SFX_IMPL_STATUSBAR_CONTROL(SvxSelectionModeControl, SfxUInt16Item);
 
 namespace {
@@ -100,10 +103,12 @@ SvxSelectionModeControl::SvxSelectionModeControl( sal_uInt16 _nSlotId,
                                                   StatusBar& rStb ) :
     SfxStatusBarControl( _nSlotId, _nId, rStb ),
     mnState( 0 ),
-    maImage(StockImage::Yes, RID_SVXBMP_SELECTION),
+    maImages{Image(StockImage::Yes, RID_SVXBMP_STANDARD_SELECTION),
+             Image(StockImage::Yes, RID_SVXBMP_EXTENDING_SELECTION),
+             Image(StockImage::Yes, RID_SVXBMP_ADDING_SELECTION),
+             Image(StockImage::Yes, RID_SVXBMP_BLOCK_SELECTION)},
     mbFeatureEnabled(false)
 {
-    GetStatusBar().SetItemText( GetId(), "" );
     GetStatusBar().SetQuickHelpText(GetId(), u"");
 }
 
@@ -116,15 +121,17 @@ void SvxSelectionModeControl::StateChanged( sal_uInt16, SfxItemState eState,
         DBG_ASSERT( dynamic_cast< const SfxUInt16Item* >(pState) !=  nullptr, "invalid item type" );
         const SfxUInt16Item* pItem = static_cast<const SfxUInt16Item*>(pState);
         mnState = pItem->GetValue();
-
         SelectionTypePopup aPop(GetStatusBar().GetFrameWeld(), mnState);
-        GetStatusBar().SetQuickHelpText(GetId(), aPop.GetItemTextForState(mnState));
+        GetStatusBar().SetQuickHelpText(GetId(),
+                                        SvxResId(RID_SVXSTR_SELECTIONMODE_HELPTEXT).
+                                        replaceFirst("%1", aPop.GetItemTextForState(mnState)));
+        GetStatusBar().Invalidate();
     }
 }
 
 bool SvxSelectionModeControl::MouseButtonDown( const MouseEvent& rEvt )
 {
-    if (!mbFeatureEnabled || !rEvt.IsMiddle())
+    if (!mbFeatureEnabled)
         return true;
 
     ::tools::Rectangle aRect(rEvt.GetPosPixel(), Size(1, 1));
@@ -165,6 +172,9 @@ bool SvxSelectionModeControl::MouseButtonDown( const MouseEvent& rEvt )
     return true;
 }
 
+void SvxSelectionModeControl::Click()
+{
+}
 
 void SvxSelectionModeControl::Paint( const UserDrawEvent& rUsrEvt )
 {
@@ -172,12 +182,15 @@ void SvxSelectionModeControl::Paint( const UserDrawEvent& rUsrEvt )
     vcl::RenderContext* pDev = rUsrEvt.GetRenderContext();
     tools::Rectangle aRect = rUsrEvt.GetRect();
 
-    Size aImgSize( maImage.GetSizePixel() );
+    Size aImgSize( maImages[mnState].GetSizePixel() );
 
     Point aPos( aRect.Left() + ( aControlRect.GetWidth() - aImgSize.Width() ) / 2,
             aRect.Top() + ( aControlRect.GetHeight() - aImgSize.Height() ) / 2 );
 
-    pDev->DrawImage(aPos, maImage, mbFeatureEnabled ? DrawImageFlags::NONE : DrawImageFlags::Disable);
+    if (mbFeatureEnabled)
+        pDev->DrawImage(aPos, maImages[mnState]);
+    else
+        pDev->DrawImage(aPos, Image());
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx
index 3759e967ff64..8600fa7819dc 100644
--- a/sw/source/uibase/uiview/view2.cxx
+++ b/sw/source/uibase/uiview/view2.cxx
@@ -1989,24 +1989,6 @@ void SwView::ExecuteStatusLine(SfxRequest &rReq)
                     }
                 }
             }
-            else
-            {
-
-                if( !rSh.IsAddMode() && !rSh.IsExtMode() && !rSh.IsBlockMode() )
-                    rSh.ToggleExtMode();
-                else if ( rSh.IsExtMode() )
-                {
-                    rSh.ToggleExtMode();
-                    rSh.ToggleAddMode();
-                }
-                else if ( rSh.IsAddMode() )
-                {
-                    rSh.ToggleAddMode();
-                    rSh.ToggleBlockMode();
-                }
-                else
-                    rSh.ToggleBlockMode();
-            }
             bUp = true;
             break;
         }


More information about the Libreoffice-commits mailing list