diff options
author | Ulrich Gemkow <lobugs@ikr.uni-stuttgart.de> | 2017-08-20 21:36:14 +0200 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2017-09-04 02:10:20 +0200 |
commit | abe958a713ff0c26a3f91c558a2f227c1996c592 (patch) | |
tree | 996d9839f9d036eb0ee9d78dd68c9df4fcc6bc47 /svtools | |
parent | 52c25a628d6cd300a0ff29f3c31e3528e3c4f8e1 (diff) |
tdf#89130 Draw: Better UI for handling layer attributes
This is a RFC to implement comment#2 in tdf#89130: Add
shortcuts to change layer attributes and make the current
attribute values visible in the tab layer name.
Already implemented is that pressing LeftMouse+Shift
toggles layer visibility. When a layer is not visible
its name is displayed in blue.
This patch adds that pressing LeftMouse+Ctrl toggles
layer locked/unlocked and LeftMouse+Ctrl+Shift toggles
layer printable/not printable.
The name of a locked layer is displayed italic. The name
of a nonprintable layer is underlined.
This also adds an Undo action for all changes to mirror
the behavior of the layer attribute change dialog box.
Change-Id: I5d8fa0585d4f088768716956583e324e66e29602
Reviewed-on: https://gerrit.libreoffice.org/41366
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/control/tabbar.cxx | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx index 8ca68320d8eb..ead6835e73c9 100644 --- a/svtools/source/control/tabbar.cxx +++ b/svtools/source/control/tabbar.cxx @@ -1173,7 +1173,6 @@ void TabBar::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& r bool bSelected = pItem->IsSelected(pCurItem); // We disable custom background color in high contrast mode. bool bCustomBgColor = !pItem->IsDefaultTabBgColor() && !rStyleSettings.GetHighContrastMode(); - bool bSpecialTab = (pItem->mnBits & TPB_DISPLAY_NAME_BLUE); OUString aText = pItem->mbShort ? rRenderContext.GetEllipsisString(pItem->maText, mnCurMaxWidth) : pItem->maText; aDrawer.setRect(aRect); @@ -1198,9 +1197,24 @@ void TabBar::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& r else rRenderContext.SetTextColor(aFaceTextColor); - // This tab is "special", and a special tab needs a blue text. - if (bSpecialTab) + // Special display of tab name depending on page bits + + if (pItem->mnBits & TPB_DISPLAY_NAME_BLUE) + { rRenderContext.SetTextColor(Color(COL_LIGHTBLUE)); + } + if (pItem->mnBits & TPB_DISPLAY_NAME_ITALIC) + { + vcl::Font aSpecialFont = rRenderContext.GetFont(); + aSpecialFont.SetItalic(FontItalic::ITALIC_NORMAL); + rRenderContext.SetFont(aSpecialFont); + } + if (pItem->mnBits & TPB_DISPLAY_NAME_UNDERLINE) + { + vcl::Font aSpecialFont = rRenderContext.GetFont(); + aSpecialFont.SetUnderline(LINESTYLE_SINGLE); + rRenderContext.SetFont(aSpecialFont); + } aDrawer.drawText(aText); @@ -1596,10 +1610,10 @@ void TabBar::AddTabClick() void TabBar::InsertPage(sal_uInt16 nPageId, const OUString& rText, TabBarPageBits nBits, sal_uInt16 nPos) { - DBG_ASSERT( nPageId, "TabBar::InsertPage(): PageId == 0" ); - DBG_ASSERT( GetPagePos( nPageId ) == PAGE_NOT_FOUND, - "TabBar::InsertPage(): PageId already exists" ); - DBG_ASSERT( nBits <= TPB_DISPLAY_NAME_BLUE, "TabBar::InsertPage(): nBits is wrong" ); + DBG_ASSERT(nPageId, "TabBar::InsertPage(): PageId == 0"); + DBG_ASSERT(GetPagePos( nPageId ) == PAGE_NOT_FOUND, + "TabBar::InsertPage(): PageId already exists"); + assert ((nBits <= TPB_DISPLAY_NAME_ALLFLAGS) && "TabBar::InsertPage(): Invalid flag set in in nBits"); // create PageItem and insert in the item list ImplTabBarItem* pItem = new ImplTabBarItem( nPageId, rText, nBits ); |