From 1dd484c8fab2e9c44ef7d3bbed4a666abc1cebe4 Mon Sep 17 00:00:00 2001 From: Pritpal Bedi Date: Tue, 31 May 2011 22:25:11 +0000 Subject: [PATCH] 2011-05-31 15:12 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) * contrib/hbide/hbide.qrc * contrib/hbide/resources/hideshow.png + Added: image for top-toolbar to activate show/hide of dock widgets. * contrib/hbide/ideactions.prg * contrib/hbide/idedocks.prg * contrib/hbide/idemain.prg * contrib/hbide/idesaveload.prg + Implemented: a single-click mechanism to hide or show all managed dock widgets in all docking areas. This can be accomplished via "Hide Show Docks" top-toolbar icon or main menu option. This implementation is extremely usable feature, requested by Massimo. Just manage docks to the desired position and areas, activate this option on/off and then see how useful it is. User gets more editing area and also has the power to do additional tasks by bringing back the last setup as and when required. The setup is remembered for the next run even if docks are hidden at the time of previous close. --- harbour/ChangeLog | 20 ++++++++++ harbour/contrib/hbide/hbide.qrc | 1 + harbour/contrib/hbide/ideactions.prg | 4 ++ harbour/contrib/hbide/idedocks.prg | 34 +++++++++++++++++ harbour/contrib/hbide/idemain.prg | 3 ++ harbour/contrib/hbide/idesaveload.prg | 38 +++++++++++++++++-- harbour/contrib/hbide/resources/hideshow.png | Bin 0 -> 651 bytes 7 files changed, 96 insertions(+), 4 deletions(-) create mode 100644 harbour/contrib/hbide/resources/hideshow.png diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 1f87467350..a21eafcb3c 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,26 @@ The license applies to all entries newer than 2009-04-28. */ +2011-05-31 15:12 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) + * contrib/hbide/hbide.qrc + * contrib/hbide/resources/hideshow.png + + Added: image for top-toolbar to activate show/hide of dock widgets. + + * contrib/hbide/ideactions.prg + * contrib/hbide/idedocks.prg + * contrib/hbide/idemain.prg + * contrib/hbide/idesaveload.prg + + Implemented: a single-click mechanism to hide or show all managed + dock widgets in all docking areas. This can be accomplished via + "Hide Show Docks" top-toolbar icon or main menu option. + + This implementation is extremely usable feature, requested by Massimo. + Just manage docks to the desired position and areas, activate this + option on/off and then see how useful it is. User gets more editing + area and also has the power to do additional tasks by bringing + back the last setup as and when required. The setup is remembered for + the next run even if docks are hidden at the time of previous close. + 2011-05-31 16:03 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/src/rtl/gttrm/gttrm.c * enable resizing if PuTTY is autodetected regardles of [HB_]TERM setting diff --git a/harbour/contrib/hbide/hbide.qrc b/harbour/contrib/hbide/hbide.qrc index d8c90a6fab..6332fc7a8e 100644 --- a/harbour/contrib/hbide/hbide.qrc +++ b/harbour/contrib/hbide/hbide.qrc @@ -282,5 +282,6 @@ resources/rp_ellipse.png resources/rp_shapes.png resources/memo.png +resources/hideshow.png diff --git a/harbour/contrib/hbide/ideactions.prg b/harbour/contrib/hbide/ideactions.prg index 5043cabe3b..873fdc1551 100644 --- a/harbour/contrib/hbide/ideactions.prg +++ b/harbour/contrib/hbide/ideactions.prg @@ -312,6 +312,7 @@ METHOD IdeActions:loadActions() aadd( aAct, { "Setup" , "hbIDE Setup" , "idepreferences" , "" , "No", "Yes" } ) * aadd( aAct, { "Tools" , "Tools and Utilities" , "tools" , "" , "No", "Yes" } ) aadd( aAct, { "ChangeLog" , "Manage ChangeLog(s)" , "memo" , "" , "No", "Yes" } ) + aadd( aAct, { "TB_Hide" , "Hide Show Docks" , "hideshow" , "" , "No", "Yes" } ) RETURN aAct @@ -332,6 +333,7 @@ METHOD IdeActions:buildToolBar() oTBar:buttonClick := {|oButton| ::oIde:execAction( oButton:key ) } oTBar:addItem( ::getAction( "TB_Exit" ), , , , , , "Exit" ) + oTBar:addItem( ::getAction( "TB_Hide" ), , , , , , "Hide" ) oTBar:addItem( ::getAction( "TB_Home" ), , , , , , "Home" ) oTBar:addItem( , , , , , nSep ) oTBar:addItem( ::getAction( "TB_New" ), , , , , , "New" ) @@ -530,6 +532,8 @@ METHOD IdeActions:buildMainMenu() oSubMenu:title := "~View" oMenuBar:addItem( { oSubMenu, NIL } ) + oSubMenu:addItem( { ::getAction( "TB_Hide" ), {|| oIde:execAction( "Hide" ) } } ) + ::oIde:qAnimateAction := QAction( oSubMenu:oWidget ) ::qAnimateAction:setText( "Toggle Animation" ) ::qAnimateAction:setCheckable( .t. ) diff --git a/harbour/contrib/hbide/idedocks.prg b/harbour/contrib/hbide/idedocks.prg index 8691fc90dd..2832e03aec 100644 --- a/harbour/contrib/hbide/idedocks.prg +++ b/harbour/contrib/hbide/idedocks.prg @@ -158,6 +158,7 @@ CLASS IdeDocks INHERIT IdeObject METHOD buildFormatWidget() METHOD showStats() METHOD hideStats() + METHOD hideAllDocks() ENDCLASS @@ -177,6 +178,39 @@ METHOD IdeDocks:create( oIde ) /*----------------------------------------------------------------------*/ +METHOD IdeDocks:hideAllDocks() + + // Left + ::oDockPT : hide() + ::oDockED : hide() + ::oSkltnsTreeDock : hide() + + // Right + ::oOutputResult : hide() + ::oEnvironDock : hide() + ::oPropertiesDock : hide() + ::oThemesDock : hide() + ::oDocViewDock : hide() + ::oDocWriteDock : hide() + ::oFindDock : hide() + ::oFunctionsDock : hide() + ::oSkeltnDock : hide() + ::oHelpDock : hide() + ::oFuncDock : hide() + ::oSourceThumbnailDock : hide() + ::oQScintillaDock : hide() + ::oReportsManagerDock : hide() + ::oFormatDock : hide() + + // Bottom + ::oDockB2 : hide() + ::oDockB1 : hide() + ::oDockB : hide() + + RETURN Self + +/*----------------------------------------------------------------------*/ + METHOD IdeDocks:destroy() LOCAL qTmp diff --git a/harbour/contrib/hbide/idemain.prg b/harbour/contrib/hbide/idemain.prg index 59b072c52b..5faaf36ced 100644 --- a/harbour/contrib/hbide/idemain.prg +++ b/harbour/contrib/hbide/idemain.prg @@ -844,6 +844,9 @@ METHOD HbIde:showApplicationCursor( nCursor ) METHOD HbIde:execAction( cKey ) SWITCH cKey + CASE "Hide" + ::oINI:showHideDocks() + EXIT CASE "ToggleStatusBar" IF ::lStatusBarVisible ::oSBar:oWidget:hide() diff --git a/harbour/contrib/hbide/idesaveload.prg b/harbour/contrib/hbide/idesaveload.prg index eeff5a2d04..c2dcaff359 100644 --- a/harbour/contrib/hbide/idesaveload.prg +++ b/harbour/contrib/hbide/idesaveload.prg @@ -159,6 +159,12 @@ CLASS IdeINI INHERIT IdeObject DATA aAppThemes INIT {} DATA lEditsMdi INIT .f. + DATA lShowEditsLeftToolbar INIT .t. + DATA lShowEditsTopToolbar INIT .t. + DATA lDocksTabShape INIT QTabWidget_Triangular + + DATA lShowHideDocks INIT .t. + METHOD new( oIde ) METHOD create( oIde ) METHOD destroy() @@ -175,6 +181,7 @@ CLASS IdeINI INHERIT IdeObject METHOD getSnippetsFile() METHOD getShortcutsFile() METHOD getThemesFile() + METHOD showHideDocks() ENDCLASS @@ -283,6 +290,21 @@ METHOD IdeINI:getThemesFile() /*------------------------------------------------------------------------*/ +METHOD IdeINI:showHideDocks() + + IF ::lShowHideDocks /* Assumed visible, hide all */ + hbide_saveSettings( ::oIde, "tempsettings.ide" ) + ::oDK:hideAllDocks() + ELSE + hbide_restSettings( ::oIde, "tempsettings.ide" ) + ENDIF + + ::lShowHideDocks := ! ::lShowHideDocks + + RETURN Self + +/*----------------------------------------------------------------------*/ + METHOD IdeINI:save( cHbideIni ) LOCAL j, nTab, pTab, n, txt_, oEdit, nTabs, nn, a_, s @@ -292,6 +314,10 @@ METHOD IdeINI:save( cHbideIni ) RETURN Nil ENDIF + IF ! ::lShowHideDocks + ::showHideDocks() + ENDIF + txt_:= {} aadd( txt_, "[HBIDE]" ) @@ -751,21 +777,25 @@ METHOD IdeINI:load( cHbideIni ) /*----------------------------------------------------------------------*/ -STATIC FUNCTION hbide_saveSettings( oIde ) +FUNCTION hbide_saveSettings( oIde, cFile ) LOCAL cPath + DEFAULT cFile TO "settings.ide" + hb_fNameSplit( oIde:cProjIni, @cPath ) - hbqt_QMainWindow_saveSettings( cPath + "settings.ide", "hbidesettings", oIde:oDlg:oWidget ) + hbqt_QMainWindow_saveSettings( cPath + cFile, "hbidesettings", oIde:oDlg:oWidget ) RETURN nil /*----------------------------------------------------------------------*/ -FUNCTION hbide_restSettings( oIde ) +FUNCTION hbide_restSettings( oIde, cFile ) LOCAL cPath + DEFAULT cFile TO "settings.ide" + hb_fNameSplit( oIde:cProjIni, @cPath ) - hbqt_QMainWindow_restSettings( cPath + "settings.ide", "hbidesettings", oIde:oDlg:oWidget ) + hbqt_QMainWindow_restSettings( cPath + cFile, "hbidesettings", oIde:oDlg:oWidget ) RETURN nil diff --git a/harbour/contrib/hbide/resources/hideshow.png b/harbour/contrib/hbide/resources/hideshow.png new file mode 100644 index 0000000000000000000000000000000000000000..d52a40fd586142974de63acdcfe1f52140654713 GIT binary patch literal 651 zcmV;60(AX}P)#aaVCYLh)A$e3#+Ip zL=jvF5eq>iL@*i`Q3@p~J7+DxpLC6A(y!(!3lC%dfAI*s|lUyI4w!Dzqs+vJ>7scMrEXuk9MFvhk ztHRj`5V-K3+%d_;r&Cs$mTe=i!O%Ofy`Z8b96%yCRhfm8wl6{P>IffPG0FMSH`bB9 zeRfG#kyjPaYz8@1Mj`-%<3F$psl5Z&0UxPYS?m5bySqry*G)0dQ^3H^oQRNc zbYdBcL}~A!QA2v|j7bjNeqlMyPTMHtP|m9;mMCZ`hyA+?xK(Z7r=+$8Wa>+hhX+k^ z@amXVk9+K*op#Hk_en})K(p^jR3vJ&h|@^e3E