diff options
author | Efe Gürkan YALAMAN <efeyalaman@gmail.com> | 2014-08-08 18:03:12 +0300 |
---|---|---|
committer | Efe Gürkan YALAMAN <efeyalaman@gmail.com> | 2014-08-08 18:25:54 +0300 |
commit | 45b7ec30200ccedde525d3719916074a5de1d559 (patch) | |
tree | e7da71bf37de31f5441cdbea3bbd8fa3be7adbba | |
parent | ced638835cf4c106476a1187c5631b98926462e3 (diff) |
Fixed the Templates button
It works as a button. When clicked the triangle works as dropdown.
Change-Id: Ib4e3b6a1832efef3382e7bd01b06d2ff8d4e7543
-rw-r--r-- | sfx2/source/dialog/backingwindow.cxx | 54 | ||||
-rw-r--r-- | sfx2/source/dialog/backingwindow.hxx | 5 | ||||
-rw-r--r-- | sfx2/uiconfig/ui/startcenter.ui | 13 |
3 files changed, 7 insertions, 65 deletions
diff --git a/sfx2/source/dialog/backingwindow.cxx b/sfx2/source/dialog/backingwindow.cxx index e05b8d982b1d..7d97dc0f3d12 100644 --- a/sfx2/source/dialog/backingwindow.cxx +++ b/sfx2/source/dialog/backingwindow.cxx @@ -69,15 +69,6 @@ const char TEMPLATE_URL[] = "slot:5500"; const char OPEN_URL[] = ".uno:Open"; const char SERVICENAME_CFGREADACCESS[] = "com.sun.star.configuration.ConfigurationAccess"; -//const char TEMPLATEBAR_SAVE[] = "template_save"; -//const char TEMPLATEBAR_OPEN[] = "open"; -//const char TEMPLATEBAR_EDIT[] = "edit"; -//const char TEMPLATEBAR_PROPERTIES[] = "properties"; -//const char TEMPLATEBAR_DEFAULT[] = "default"; -//const char TEMPLATEBAR_MOVE[] = "move"; -//const char TEMPLATEBAR_EXPORT[] = "export"; -//const char TEMPLATEBAR_DELETE[] = "template_delete"; - const int nButtonsFontSize = 15; float fMultiplier = 1.2f; const Color aButtonsBackground(114, 168, 84); // TDF green @@ -123,9 +114,6 @@ BackingWindow::BackingWindow( Window* i_pParent ) : get(mpHelpButton, "help"); get(mpExtensionsButton, "extensions"); - //get(mpViewBar, "action_view"); - //get(mpTemplateBar, "action_templates"); - //Containers are invisible to cursor traversal //So on pressing "right" when in Help the //extension button is considered as a candidate @@ -267,7 +255,7 @@ void BackingWindow::initControls() mpAllRecentThumbnails->Reload(); mpAllRecentThumbnails->ShowTooltips( true ); - //initialize Template views + //initialize Template view mpLocalView->SetStyle( mpLocalView->GetStyle() | WB_VSCROLL); mpLocalView->setItemDimensions(TEMPLATE_ITEM_MAX_WIDTH,TEMPLATE_ITEM_THUMBNAIL_MAX_HEIGHT, TEMPLATE_ITEM_MAX_HEIGHT-TEMPLATE_ITEM_THUMBNAIL_MAX_HEIGHT, @@ -279,25 +267,12 @@ void BackingWindow::initControls() mpCurrentView = mpLocalView; - //mpViewBar->SetButtonType(BUTTON_SYMBOLTEXT); - //mpViewBar->SetItemBits(mpViewBar->GetItemId("repository"), TIB_DROPDOWNONLY); - //mpViewBar->SetClickHdl(LINK(this,BackingWindow,TBXViewHdl)); - //mpViewBar->SetDropdownClickHdl(LINK(this,BackingWindow,TBXDropdownHdl)); - //mpViewBar->Hide(); - //mpViewBar->HideItem("import"); - - //mpTemplateBar->SetButtonType(BUTTON_SYMBOLTEXT); - //mpTemplateBar->SetItemBits(mpTemplateBar->GetItemId(TEMPLATEBAR_MOVE), TIB_DROPDOWNONLY); - //mpTemplateBar->SetClickHdl( LINK( this, BackingWindow,TBXTemplateHdl ) ); - //mpTemplateBar->SetDoubleClickHdl( LINK(this, BackingWindow, OpenTemplateHdl) ); - //mpTemplateBar->SetDropdownClickHdl(LINK(this, BackingWindow,TBXDropdownHdl)); + mpTemplateButton->SetMenuMode( MENUBUTTON_MENUMODE_TIMED ); //set handlers mpLocalView->setOpenRegionHdl(LINK(this, BackingWindow, OpenRegionHdl)); mpLocalView->setOpenTemplateHdl(LINK(this,BackingWindow,OpenTemplateHdl)); - /*FIXME: Add other things for Local View*/ - setupButton( mpOpenButton ); setupButton( mpTemplateButton ); setupButton( mpWriterAllButton ); @@ -351,7 +326,6 @@ void BackingWindow::setupButton( PushButton* pButton ) // color that fits the theme pButton->SetControlForeground(aButtonsText); - pButton->SetClickHdl( LINK( this, BackingWindow, ClickHdl ) ); } @@ -362,12 +336,11 @@ void BackingWindow::setupButton( MenuButton* pButton ) pButton->SetControlFont(aFont); pButton->SetControlForeground(aButtonsText); - //Menubutton implementation PopupMenu* pMenu = mpTemplateButton->GetPopupMenu(); pMenu->SetMenuFlags( pMenu->GetMenuFlags() | MENU_FLAG_ALWAYSSHOWDISABLEDENTRIES ); - //pButton->SetClickHdl( LINK( this, BackingWindow, ClickHdl ) ); + pButton->SetClickHdl( LINK( this, BackingWindow, ClickHdl ) ); pButton->SetSelectHdl( LINK( this, BackingWindow, MenuSelectHdl ) ); } @@ -574,18 +547,9 @@ IMPL_LINK( BackingWindow, ClickHdl, Button*, pButton ) } else if( pButton == mpTemplateButton ) { -/* 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(); + mpCurrentView->filterItems(ViewFilter_Application(FILTER_APP_NONE)); mpLocalView->Show(); - //mpViewBar->Hide(); } return 0; } @@ -594,11 +558,7 @@ IMPL_LINK( BackingWindow, MenuSelectHdl, MenuButton*, pButton ) { OString sId = pButton->GetCurItemIdent(); - if( sId == "filter_none" ) - { - mpCurrentView->filterItems(ViewFilter_Application(FILTER_APP_NONE)); - } - else if( sId == "filter_writer" ) + if( sId == "filter_writer" ) { mpCurrentView->filterItems(ViewFilter_Application(FILTER_APP_WRITER)); } @@ -627,7 +587,6 @@ IMPL_LINK( BackingWindow, MenuSelectHdl, MenuButton*, pButton ) } - mpAllRecentThumbnails->Hide(); mpLocalView->Show(); @@ -639,13 +598,10 @@ IMPL_LINK_NOARG( BackingWindow, OpenRegionHdl) { maSelFolders.clear(); maSelTemplates.clear(); - //mpTemplateBar->Hide(); - //mpViewBar->Hide(); return 0; } -//FIXME: Cleanup the code IMPL_LINK(BackingWindow, OpenTemplateHdl, ThumbnailViewItem*, pItem) { if (!mbIsSaveMode) diff --git a/sfx2/source/dialog/backingwindow.hxx b/sfx2/source/dialog/backingwindow.hxx index f842644585ec..e4f7a39479b6 100644 --- a/sfx2/source/dialog/backingwindow.hxx +++ b/sfx2/source/dialog/backingwindow.hxx @@ -57,11 +57,11 @@ class BackingWindow com::sun::star::uno::Reference<com::sun::star::frame::XDispatchProvider > mxDesktopDispatchProvider; com::sun::star::uno::Reference<com::sun::star::frame::XFrame> mxFrame; com::sun::star::uno::Reference< com::sun::star::frame::XDesktop2 > mxDesktop; + /** helper for drag&drop. */ com::sun::star::uno::Reference< com::sun::star::datatransfer::dnd::XDropTargetListener > mxDropTargetListener; PushButton* mpOpenButton; - //PushButton* mpTemplateButton; MenuButton* mpTemplateButton; FixedText* mpCreateLabel; @@ -88,9 +88,6 @@ class BackingWindow TemplateLocalView* mpLocalView; TemplateAbstractView* mpCurrentView; - //ToolBox* mpViewBar; - //ToolBox* mpTemplateBar; - std::vector<Window*> maDndWindows; Rectangle maStartCentButtons; diff --git a/sfx2/uiconfig/ui/startcenter.ui b/sfx2/uiconfig/ui/startcenter.ui index 3185bfaa8060..c6190589483a 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 Fri Aug 1 02:51:49 2014 --> +<!-- Generated with glade 3.16.0 on Fri Aug 8 17:26:41 2014 --> <interface> <!-- interface-requires gtk+ 3.0 --> <!-- interface-requires LibreOffice 1.0 --> @@ -434,19 +434,10 @@ <property name="visible">True</property> <property name="can_focus">False</property> <child> - <object class="GtkMenuItem" id="filter_none"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label" translatable="yes">All Templates</property> - <property name="use_underline">True</property> - </object> - </child> - <child> <object class="GtkMenuItem" id="filter_writer"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="label" translatable="yes">Writer Templates</property> - <property name="use_underline">True</property> </object> </child> <child> @@ -454,7 +445,6 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="label" translatable="yes">Calc Templates</property> - <property name="use_underline">True</property> </object> </child> <child> @@ -462,7 +452,6 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="label" translatable="yes">Impress Templates</property> - <property name="use_underline">True</property> </object> </child> <child> |