diff options
author | Efe Gürkan YALAMAN <efeyalaman@gmail.com> | 2014-08-01 02:46:51 +0300 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2014-08-14 22:20:26 +0200 |
commit | d351591593aada8a55d58068516643eb353a76ec (patch) | |
tree | cd4d07af1485885dda7b4b89bc7c9acbc0176de5 /sfx2 | |
parent | 13c4d0abf2af43a212922cec3904bcf8a5671aeb (diff) |
Some code cleanup
SetupButton function overloaded for MenuButton type.
Change-Id: Ib171c7590a59ad360dd8ebab1039d3eba5d565ef
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/dialog/backingwindow.cxx | 56 | ||||
-rw-r--r-- | sfx2/source/dialog/backingwindow.hxx | 1 | ||||
-rw-r--r-- | sfx2/uiconfig/ui/startcenter.ui | 9 |
3 files changed, 34 insertions, 32 deletions
diff --git a/sfx2/source/dialog/backingwindow.cxx b/sfx2/source/dialog/backingwindow.cxx index 6e949346d31c..e306dd54d2d4 100644 --- a/sfx2/source/dialog/backingwindow.cxx +++ b/sfx2/source/dialog/backingwindow.cxx @@ -53,9 +53,6 @@ #include <com/sun/star/task/InteractionHandler.hpp> #include <com/sun/star/ui/dialogs/TemplateDescription.hpp> -//FIXME:well find a better way for it. -#include "../doc/doc.hrc" - using namespace ::com::sun::star; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::frame; @@ -295,32 +292,13 @@ void BackingWindow::initControls() //mpTemplateBar->SetDropdownClickHdl(LINK(this, BackingWindow,TBXDropdownHdl)); //set handlers - //mpLocalView->setItemStateHdl(LINK(this, BackingWindow, TVItemStateHdl)); mpLocalView->setOpenRegionHdl(LINK(this, BackingWindow, OpenRegionHdl)); mpLocalView->setOpenTemplateHdl(LINK(this,BackingWindow,OpenTemplateHdl)); - /*FIXME: Add other things for Local View - *Filter and the bars*/ + /*FIXME: Add other things for Local View*/ setupButton( mpOpenButton ); - //setupButton( mpTemplateButton ); - Font aFont(mpTemplateButton->GetSettings().GetStyleSettings().GetPushButtonFont()); - aFont.SetSize(Size(0, aFont.GetSize().Height() * fMultiplier)); - mpTemplateButton->SetControlFont(aFont); - - // color that fits the theme - mpTemplateButton->SetControlForeground(aButtonsText); - - - - //Menubutton implementation - PopupMenu* pMenu = mpTemplateButton->GetPopupMenu(); - pMenu->SetMenuFlags( - pMenu->GetMenuFlags() | MENU_FLAG_ALWAYSSHOWDISABLEDENTRIES ); - - mpTemplateButton->SetSelectHdl(LINK(this,BackingWindow,MenuSelectHdl)); - mpTemplateButton->SetClickHdl( LINK(this, BackingWindow, ClickHdl) ); - + setupButton( mpTemplateButton ); setupButton( mpWriterAllButton ); setupButton( mpDrawAllButton ); setupButton( mpCalcAllButton ); @@ -374,6 +352,24 @@ void BackingWindow::setupButton( PushButton* pButton ) pButton->SetClickHdl( LINK( this, BackingWindow, ClickHdl ) ); } +void BackingWindow::setupButton( MenuButton* pButton ) +{ + Font aFont(pButton->GetSettings().GetStyleSettings().GetPushButtonFont()); + aFont.SetSize(Size(0, aFont.GetSize().Height() * fMultiplier)); + pButton->SetControlFont(aFont); + + // color that fits the theme + pButton->SetControlForeground(aButtonsText); + + //Menubutton implementation + PopupMenu* pMenu = pButton->GetPopupMenu(); + pMenu->SetMenuFlags(pMenu->GetMenuFlags() | MENU_FLAG_ALWAYSSHOWDISABLEDENTRIES); + + pButton->SetClickHdl(LINK(this, BackingWindow, ClickHdl)); + pButton->SetSelectHdl(LINK(this, BackingWindow, MenuSelectHdl)); +} + + void BackingWindow::Paint( const Rectangle& ) { Resize(); @@ -612,6 +608,18 @@ IMPL_LINK( BackingWindow, MenuSelectHdl, MenuButton*, pButton ) { mpLocalView->filterItems(ViewFilter_Application(FILTER_APP_DRAW)); } + else if( sId == "edit" ) + { + Reference< XDispatchProvider > xFrame( mxFrame, UNO_QUERY ); + + Sequence< com::sun::star::beans::PropertyValue > aArgs(1); + PropertyValue* pArg = aArgs.getArray(); + pArg[0].Name = "Referer"; + pArg[0].Value <<= OUString("private:user"); + + dispatchURL( TEMPLATE_URL, OUString(), xFrame, aArgs ); + + } mpAllRecentThumbnails->Hide(); diff --git a/sfx2/source/dialog/backingwindow.hxx b/sfx2/source/dialog/backingwindow.hxx index 586b879e4bc1..f842644585ec 100644 --- a/sfx2/source/dialog/backingwindow.hxx +++ b/sfx2/source/dialog/backingwindow.hxx @@ -101,6 +101,7 @@ class BackingWindow svt::AcceleratorExecute* mpAccExec; void setupButton( PushButton* pButton ); + void setupButton( MenuButton* pButton ); //Template Manager void OnTemplateOpen (); diff --git a/sfx2/uiconfig/ui/startcenter.ui b/sfx2/uiconfig/ui/startcenter.ui index 6cbbd64ea4f6..eb6fbf26e511 100644 --- a/sfx2/uiconfig/ui/startcenter.ui +++ b/sfx2/uiconfig/ui/startcenter.ui @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.16.0 on Wed Jul 23 16:41:24 2014 --> +<!-- Generated with glade 3.16.0 on Sun Jul 27 15:03:37 2014 --> <interface> <!-- interface-requires gtk+ 3.0 --> <!-- interface-requires LibreOffice 1.0 --> @@ -465,13 +465,6 @@ </object> </child> <child> - <object class="GtkMenuItem" id="filter_math"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label" translatable="yes">Math Templates</property> - </object> - </child> - <child> <object class="GtkSeparatorMenuItem" id="menuitem3"> <property name="visible">True</property> <property name="can_focus">False</property> |