From 40e85aadbff8eaeba20ee6a39ca669d282d91005 Mon Sep 17 00:00:00 2001 From: Sarabjot Singh Date: Fri, 28 Feb 2020 22:47:40 +0300 Subject: tdf#104169 - Change mouse cursor to FatCross in calc spreadsheet MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added new cursor FatCross to calc. Change mouse cursor to FatCross while hovering over the spreadsheet in calc instead of earlier Arrow. Co-authored-by: Mesut Çifci Change-Id: I672a058cc702eab0cba6ac953534def915766859 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114679 Tested-by: Jenkins Reviewed-by: Heiko Tietze --- icon-themes/colibre/vcl/res/fatcross.png | Bin 0 -> 311 bytes icon-themes/colibre_svg/vcl/res/fatcross.svg | 1 + include/vcl/ptrstyle.hxx | 3 ++- sc/source/ui/drawfunc/fudraw.cxx | 2 +- sc/source/ui/view/gridwin.cxx | 4 ++-- sc/source/ui/view/tabview5.cxx | 2 +- vcl/inc/bitmaps.hlst | 1 + vcl/inc/cursor_hotspots.hxx | 2 ++ vcl/inc/unx/x11_cursors/fatcross_curs.h | 34 +++++++++++++++++++++++++++ vcl/inc/unx/x11_cursors/fatcross_mask.h | 34 +++++++++++++++++++++++++++ vcl/inc/unx/x11_cursors/salcursors.h | 2 ++ vcl/inc/win/salids.hrc | 1 + vcl/osx/saldata.cxx | 2 ++ vcl/qt5/Qt5Data.cxx | 5 +++- vcl/unx/generic/app/saldisp.cxx | 3 +++ vcl/unx/gtk3/gtkdata.cxx | 1 + vcl/win/src/fatcross.cur | Bin 0 -> 4286 bytes vcl/win/src/salsrc.rc | 1 + vcl/win/window/salframe.cxx | 4 +++- vcl/workben/vcldemo.cxx | 1 + 20 files changed, 96 insertions(+), 7 deletions(-) create mode 100755 icon-themes/colibre/vcl/res/fatcross.png create mode 100644 icon-themes/colibre_svg/vcl/res/fatcross.svg create mode 100644 vcl/inc/unx/x11_cursors/fatcross_curs.h create mode 100644 vcl/inc/unx/x11_cursors/fatcross_mask.h create mode 100755 vcl/win/src/fatcross.cur diff --git a/icon-themes/colibre/vcl/res/fatcross.png b/icon-themes/colibre/vcl/res/fatcross.png new file mode 100755 index 000000000000..bf13fd80b06c Binary files /dev/null and b/icon-themes/colibre/vcl/res/fatcross.png differ diff --git a/icon-themes/colibre_svg/vcl/res/fatcross.svg b/icon-themes/colibre_svg/vcl/res/fatcross.svg new file mode 100644 index 000000000000..e2bed8d22b3e --- /dev/null +++ b/icon-themes/colibre_svg/vcl/res/fatcross.svg @@ -0,0 +1 @@ + diff --git a/include/vcl/ptrstyle.hxx b/include/vcl/ptrstyle.hxx index e2ae0238e301..fa45246a816d 100644 --- a/include/vcl/ptrstyle.hxx +++ b/include/vcl/ptrstyle.hxx @@ -116,7 +116,8 @@ enum class PointerStyle TabSelectSW, HideWhitespace, ShowWhitespace, - LAST = ShowWhitespace, + FatCross, + LAST = FatCross, }; #endif // INCLUDED_VCL_PTRSTYLE_HXX diff --git a/sc/source/ui/drawfunc/fudraw.cxx b/sc/source/ui/drawfunc/fudraw.cxx index 2069bace5936..81057be0feb4 100644 --- a/sc/source/ui/drawfunc/fudraw.cxx +++ b/sc/source/ui/drawfunc/fudraw.cxx @@ -59,7 +59,7 @@ void collectUIInformation( const OUString& aevent ) FuDraw::FuDraw(ScTabViewShell& rViewSh, vcl::Window* pWin, ScDrawView* pViewP, SdrModel* pDoc, const SfxRequest& rReq) : FuPoor(rViewSh, pWin, pViewP, pDoc, rReq) - , aNewPointer(PointerStyle::Arrow) + , aNewPointer(PointerStyle::FatCross) , aOldPointer(PointerStyle::Arrow) { } diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 166bdd265e09..408034bd74f3 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -2014,7 +2014,7 @@ void ScGridWindow::MouseButtonUp( const MouseEvent& rMEvt ) rMark.SetMarking(false); - SetPointer( PointerStyle::Arrow ); + SetPointer( PointerStyle::FatCross ); if (mrViewData.IsFillMode() || ( mrViewData.GetFillMode() == ScFillMode::MATRIX && rMEvt.IsMod1() )) @@ -2600,7 +2600,7 @@ void ScGridWindow::MouseMove( const MouseEvent& rMEvt ) bool bAlt = rMEvt.IsMod2(); if (bEditMode) // First has to be in edit mode! - SetPointer( PointerStyle::Arrow ); + SetPointer( PointerStyle::FatCross ); else if ( !bAlt && !nButtonDown && ScGlobal::ShouldOpenURL() && GetEditUrl(rMEvt.GetPosPixel()) ) SetPointer( PointerStyle::RefHand ); diff --git a/sc/source/ui/view/tabview5.cxx b/sc/source/ui/view/tabview5.cxx index fde36dce68cd..af7c3dfb19b7 100644 --- a/sc/source/ui/view/tabview5.cxx +++ b/sc/source/ui/view/tabview5.cxx @@ -648,7 +648,7 @@ void ScTabView::ResetBrushDocument() if ( HasPaintBrush() ) { SetBrushDocument( nullptr, false ); - SetActivePointer( PointerStyle::Arrow ); // switch pointers also when ended with escape key + SetActivePointer( PointerStyle::FatCross ); // switch pointers also when ended with escape key } } diff --git a/vcl/inc/bitmaps.hlst b/vcl/inc/bitmaps.hlst index 02e3dea0f540..c370883e26dc 100644 --- a/vcl/inc/bitmaps.hlst +++ b/vcl/inc/bitmaps.hlst @@ -218,6 +218,7 @@ #define RID_CURSOR_WINDOW_NESIZE "vcl/res/window_nesize.png" #define RID_CURSOR_WINDOW_SWSIZE "vcl/res/window_swsize.png" #define RID_CURSOR_WINDOW_SESIZE "vcl/res/window_sesize.png" +#define RID_CURSOR_FATCROSS "vcl/res/fatcross.png" #define CHEVRON "sfx2/res/chevron.png" diff --git a/vcl/inc/cursor_hotspots.hxx b/vcl/inc/cursor_hotspots.hxx index 74a041ddd9ca..7f356fa956dc 100644 --- a/vcl/inc/cursor_hotspots.hxx +++ b/vcl/inc/cursor_hotspots.hxx @@ -163,6 +163,8 @@ #define window_swsize_curs_y_hot 10 #define window_sesize_curs_x_hot 10 #define window_sesize_curs_y_hot 10 +#define fatcross_curs_x_hot 15 +#define fatcross_curs_y_hot 15 #endif diff --git a/vcl/inc/unx/x11_cursors/fatcross_curs.h b/vcl/inc/unx/x11_cursors/fatcross_curs.h new file mode 100644 index 000000000000..64322342a3c7 --- /dev/null +++ b/vcl/inc/unx/x11_cursors/fatcross_curs.h @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#define fatcross_curs_width 32 +#define fatcross_curs_height 32 +#define fatcross_curs_x_hot 15 +#define fatcross_curs_y_hot 15 +static unsigned char fatcross_curs_bits[] + = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, + 0x0f, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0x08, 0x08, 0x00, 0x80, + 0x0f, 0xf8, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, + 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, + 0x00, 0x80, 0x0f, 0xf8, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0x08, + 0x08, 0x00, 0x00, 0xf8, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/unx/x11_cursors/fatcross_mask.h b/vcl/inc/unx/x11_cursors/fatcross_mask.h new file mode 100644 index 000000000000..d3db67d647c3 --- /dev/null +++ b/vcl/inc/unx/x11_cursors/fatcross_mask.h @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#define fatcross_mask_width 32 +#define fatcross_mask_height 32 +#define fatcross_mask_x_hot 15 +#define fatcross_mask_y_hot 15 +static unsigned char fatcross_mask_bits[] + = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, + 0x0f, 0x00, 0x00, 0xf8, 0x0f, 0x00, 0x00, 0xf8, 0x0f, 0x00, 0x00, 0xf8, 0x0f, 0x00, 0x80, + 0xff, 0xff, 0x00, 0x80, 0xff, 0xff, 0x00, 0x80, 0xff, 0xff, 0x00, 0x80, 0xff, 0xff, 0x00, + 0x80, 0xff, 0xff, 0x00, 0x80, 0xff, 0xff, 0x00, 0x80, 0xff, 0xff, 0x00, 0x80, 0xff, 0xff, + 0x00, 0x80, 0xff, 0xff, 0x00, 0x00, 0xf8, 0x0f, 0x00, 0x00, 0xf8, 0x0f, 0x00, 0x00, 0xf8, + 0x0f, 0x00, 0x00, 0xf8, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/unx/x11_cursors/salcursors.h b/vcl/inc/unx/x11_cursors/salcursors.h index 1b8aa6c08a59..afe8fc756f49 100644 --- a/vcl/inc/unx/x11_cursors/salcursors.h +++ b/vcl/inc/unx/x11_cursors/salcursors.h @@ -147,5 +147,7 @@ #include #include #include +#include +#include /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/win/salids.hrc b/vcl/inc/win/salids.hrc index 092a24b5225b..7212ee902295 100644 --- a/vcl/inc/win/salids.hrc +++ b/vcl/inc/win/salids.hrc @@ -83,6 +83,7 @@ #define SAL_RESID_POINTER_TAB_SELECT_SW 10077 #define SAL_RESID_POINTER_HIDEWHITESPACE 10079 #define SAL_RESID_POINTER_SHOWWHITESPACE 10080 +#define SAL_RESID_POINTER_FATCROSS 10081 #define SAL_RESID_BITMAP_50 11000 diff --git a/vcl/osx/saldata.cxx b/vcl/osx/saldata.cxx index bf0659f0f0d8..d49df78d2ccf 100644 --- a/vcl/osx/saldata.cxx +++ b/vcl/osx/saldata.cxx @@ -240,6 +240,8 @@ NSCursor* SalData::getCursor( PointerStyle i_eStyle ) MAKE_CURSOR( PointerStyle::HideWhitespace, hidewhitespace_, RID_CURSOR_HIDE_WHITESPACE ); MAKE_CURSOR( PointerStyle::ShowWhitespace, showwhitespace_, RID_CURSOR_SHOW_WHITESPACE ); + MAKE_CURSOR( PointerStyle::FatCross, fatcross_, RID_CURSOR_FATCROSS ); + default: SAL_WARN( "vcl", "pointer style " << static_cast(i_eStyle) << "not implemented" ); assert( false && "pointer style not implemented" ); diff --git a/vcl/qt5/Qt5Data.cxx b/vcl/qt5/Qt5Data.cxx index c50f8c57ddc6..45e71765bac1 100644 --- a/vcl/qt5/Qt5Data.cxx +++ b/vcl/qt5/Qt5Data.cxx @@ -150,6 +150,8 @@ #include #include #include +#include +#include #include @@ -181,7 +183,6 @@ static QCursor* getQCursorFromXBM(const unsigned char* pBitmap, const unsigned c QBitmap aMask = QBitmap::fromData(QSize(nWidth, nHeight), pMask); return new QCursor(aPixmap, aMask, nXHot, nYHot); } - #define MAKE_CURSOR(vcl_name, name) \ case vcl_name: \ pCursor = getQCursorFromXBM(name##curs##_bits, name##mask##_bits, name##curs_width, \ @@ -302,6 +303,8 @@ QCursor& Qt5Data::getCursor(PointerStyle ePointerStyle) MAKE_CURSOR(PointerStyle::HideWhitespace, hidewhitespace_); MAKE_CURSOR(PointerStyle::ShowWhitespace, showwhitespace_); + + MAKE_CURSOR(PointerStyle::FatCross, fatcross_); default: break; } diff --git a/vcl/unx/generic/app/saldisp.cxx b/vcl/unx/generic/app/saldisp.cxx index ce72a42494e9..4272f9e89812 100644 --- a/vcl/unx/generic/app/saldisp.cxx +++ b/vcl/unx/generic/app/saldisp.cxx @@ -1802,6 +1802,9 @@ Cursor SalDisplay::GetPointer( PointerStyle ePointerStyle ) case PointerStyle::ShowWhitespace: MAKE_CURSOR( showwhitespace_ ); break; + case PointerStyle::FatCross: + MAKE_CURSOR( fatcross_ ); + break; default: OSL_FAIL("pointer not implemented"); diff --git a/vcl/unx/gtk3/gtkdata.cxx b/vcl/unx/gtk3/gtkdata.cxx index 639eedb62c87..931454fbb396 100644 --- a/vcl/unx/gtk3/gtkdata.cxx +++ b/vcl/unx/gtk3/gtkdata.cxx @@ -265,6 +265,7 @@ GdkCursor *GtkSalDisplay::getCursor( PointerStyle ePointerStyle ) MAKE_CURSOR( PointerStyle::HideWhitespace, hidewhitespace_, RID_CURSOR_HIDE_WHITESPACE ); MAKE_CURSOR( PointerStyle::ShowWhitespace, showwhitespace_, RID_CURSOR_SHOW_WHITESPACE ); + MAKE_CURSOR( PointerStyle::FatCross, fatcross_, RID_CURSOR_FATCROSS ); default: SAL_WARN( "vcl.gtk", "pointer " << static_cast(ePointerStyle) << "not implemented" ); diff --git a/vcl/win/src/fatcross.cur b/vcl/win/src/fatcross.cur new file mode 100755 index 000000000000..68f095f15fd4 Binary files /dev/null and b/vcl/win/src/fatcross.cur differ diff --git a/vcl/win/src/salsrc.rc b/vcl/win/src/salsrc.rc index a4c5cf574e6a..b23ac149a7fe 100644 --- a/vcl/win/src/salsrc.rc +++ b/vcl/win/src/salsrc.rc @@ -81,6 +81,7 @@ SAL_RESID_POINTER_TAB_SELECT_W CURSOR tblselw.cur SAL_RESID_POINTER_TAB_SELECT_SW CURSOR tblselsw.cur SAL_RESID_POINTER_HIDEWHITESPACE CURSOR wshide.cur SAL_RESID_POINTER_SHOWWHITESPACE CURSOR wsshow.cur +SAL_RESID_POINTER_FATCROSS CURSOR fatcross.cur SAL_RESID_BITMAP_50 BITMAP "50.bmp" diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx index c87e290bdad2..a727d8a76462 100644 --- a/vcl/win/window/salframe.cxx +++ b/vcl/win/window/salframe.cxx @@ -2144,7 +2144,9 @@ void WinSalFrame::SetPointer( PointerStyle ePointerStyle ) { nullptr, nullptr, SAL_RESID_POINTER_TAB_SELECT_SW }, // POINTER_TAB_SELECT_SW { nullptr, nullptr, SAL_RESID_POINTER_HIDEWHITESPACE }, // POINTER_HIDEWHITESPACE - { nullptr, nullptr, SAL_RESID_POINTER_SHOWWHITESPACE } // POINTER_UNHIDEWHITESPACE + { nullptr, nullptr, SAL_RESID_POINTER_SHOWWHITESPACE }, // POINTER_UNHIDEWHITESPACE + + { nullptr, nullptr, SAL_RESID_POINTER_FATCROSS } // POINTER_FATCROSS }; // Mousepointer loaded ? diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx index 45d541c35546..38557c20b955 100644 --- a/vcl/workben/vcldemo.cxx +++ b/vcl/workben/vcldemo.cxx @@ -1885,6 +1885,7 @@ const PointerData gvPointerData [] = { { PointerStyle::TabSelectSW, "TabSelectSW" }, { PointerStyle::HideWhitespace, "HideWhitespace" }, { PointerStyle::ShowWhitespace, "ShowWhitespace" }, + { PointerStyle::FatCross, "FatCross" }, }; namespace { -- cgit