2010-07-07 18:44 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)

* contrib/hbide/idemisc.prg
  * contrib/hbide/idesaveload.prg
  * contrib/hbide/idestylesheets.prg
  * contrib/hbide/setup.ui
    + Implemented: application of constructed gradients to hbIDE components. 
      Now n number of gradients can be defined to be applied to 
      hbIDE. "Toggle Animation" respects these settings as well.
      <Setup Dialog><Themes> provides you with necessary constructs
      to define and apply. Still the last applied is not saved: TODO.
      So next run will revert to defaults as per animation mode.
This commit is contained in:
Pritpal Bedi
2010-07-08 01:48:10 +00:00
parent 8e23274cd7
commit c20d0cbbab
5 changed files with 175 additions and 18 deletions

View File

@@ -16,6 +16,18 @@
The license applies to all entries newer than 2009-04-28.
*/
2010-07-07 18:44 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)
* contrib/hbide/idemisc.prg
* contrib/hbide/idesaveload.prg
* contrib/hbide/idestylesheets.prg
* contrib/hbide/setup.ui
+ Implemented: application of constructed gradients to hbIDE components.
Now n number of gradients can be defined to be applied to
hbIDE. "Toggle Animation" respects these settings as well.
<Setup Dialog><Themes> provides you with necessary constructs
to define and apply. Still the last applied is not saved: TODO.
So next run will revert to defaults as per animation mode.
2010-07-07 23:11 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* src/rdd/sdf1.c
* src/rdd/delim1.c

View File

@@ -1996,6 +1996,40 @@ FUNCTION hbide_parseKeywordsComponents( cStr )
/*----------------------------------------------------------------------*/
FUNCTION hbide_parseThemeComponent( cComponent )
LOCAL i, a_, n
a_:= hb_aTokens( cComponent, "," )
aSize( a_, 6 )
DEFAULT a_[ 1 ] TO ""
DEFAULT a_[ 2 ] TO ""
DEFAULT a_[ 3 ] TO ""
DEFAULT a_[ 4 ] TO ""
DEFAULT a_[ 5 ] TO ""
DEFAULT a_[ 6 ] TO ""
a_[ 1 ] := alltrim( a_[ 1 ] )
a_[ 2 ] := alltrim( a_[ 2 ] )
a_[ 3 ] := alltrim( a_[ 3 ] )
a_[ 4 ] := alltrim( a_[ 4 ] )
a_[ 5 ] := alltrim( a_[ 5 ] )
a_[ 6 ] := alltrim( a_[ 6 ] )
FOR i := 2 TO 6
IF !empty( a_[ i ] )
a_[ i ] := hb_aTokens( a_[ i ], " " )
FOR EACH n IN a_[ i ]
n := val( n )
NEXT
ELSE
a_[ i ] := {}
ENDIF
NEXT
RETURN a_
/*----------------------------------------------------------------------*/
FUNCTION hbide_SetWrkFolderLast( cPathFile )
LOCAL cPth, cOldPath

View File

@@ -847,6 +847,7 @@ CLASS IdeSetup INHERIT IdeObject
METHOD fetchThemeColorsString( nSlot )
METHOD pushThemeColors( nTheme )
METHOD pushThemesData()
METHOD getThemeData( nTheme )
ENDCLASS
@@ -903,7 +904,7 @@ METHOD IdeSetup:setIcons()
::oUI:q_buttonThmAdd : setIcon( hbide_image( "dc_plus" ) )
::oUI:q_buttonThmDel : setIcon( hbide_image( "dc_delete" ) )
::oUI:q_buttonThmCpy : setIcon( hbide_image( "copy" ) )
::oUI:q_buttonThmApp : setIcon( hbide_image( "copy" ) )
::oUI:q_buttonThmSav : setIcon( hbide_image( "save" ) )
RETURN Self
@@ -935,6 +936,23 @@ METHOD IdeSetup:disConnectSlots()
::disconnect( ::oUI:q_checkHorzRuler , "stateChanged(int)" )
::disconnect( ::oUI:q_checkLineNumbers, "stateChanged(int)" )
::disconnect( ::oUI:q_sliderRed , "valueChanged(int)" )
::disconnect( ::oUI:q_sliderGreen , "valueChanged(int)" )
::disconnect( ::oUI:q_sliderBlue , "valueChanged(int)" )
::disconnect( ::oUI:q_radioSec1 , "clicked()" )
::disconnect( ::oUI:q_radioSec2 , "clicked()" )
::disconnect( ::oUI:q_radioSec3 , "clicked()" )
::disconnect( ::oUI:q_radioSec4 , "clicked()" )
::disconnect( ::oUI:q_radioSec5 , "clicked()" )
::disconnect( ::oUI:q_buttonThmAdd , "clicked()" )
::disconnect( ::oUI:q_buttonThmDel , "clicked()" )
::disconnect( ::oUI:q_buttonThmApp , "clicked()" )
::disconnect( ::oUI:q_buttonThmSav , "clicked()" )
::disconnect( ::oUI:q_listThemes , "currentRowChanged(int)" )
RETURN Self
/*----------------------------------------------------------------------*/
@@ -976,7 +994,7 @@ METHOD IdeSetup:connectSlots()
::connect( ::oUI:q_buttonThmAdd , "clicked()" , {| | ::execEvent( "buttonThmAdd_clicked" ) } )
::connect( ::oUI:q_buttonThmDel , "clicked()" , {| | ::execEvent( "buttonThmDel_clicked" ) } )
::connect( ::oUI:q_buttonThmCpy , "clicked()" , {| | ::execEvent( "buttonThmCpy_clicked" ) } )
::connect( ::oUI:q_buttonThmApp , "clicked()" , {| | ::execEvent( "buttonThmApp_clicked" ) } )
::connect( ::oUI:q_buttonThmSav , "clicked()" , {| | ::execEvent( "buttonThmSav_clicked" ) } )
::connect( ::oUI:q_listThemes , "currentRowChanged(int)" , {|i| ::execEvent( "listThemes_currentRowChanged", i ) } )
@@ -1018,9 +1036,9 @@ METHOD IdeSetup:retrieve()
s := substr( s, 1, len( s ) - 1 )
::oINI:cTextFileExtensions := s
::oINI:nTmpBkpPrd := val( ::oUI:q_editTmpBkpPrd : text() )
::oINI:cBkpPath := ::oUI:q_editBkpPath : text()
::oINI:cBkpSuffix := ::oUI:q_editBkpSuffix : text()
::oINI:nTmpBkpPrd := val( ::oUI:q_editTmpBkpPrd : text() )
::oINI:cBkpPath := ::oUI:q_editBkpPath : text()
::oINI:cBkpSuffix := ::oUI:q_editBkpSuffix : text()
::oINI:lCompletionWithArgs := ::oUI:q_checkListlWithArgs : isChecked()
::oINI:lCompleteArgumented := ::oUI:q_checkCmplInclArgs : isChecked()
@@ -1096,10 +1114,10 @@ METHOD IdeSetup:populate()
::oUI:q_editSec1:setReadOnly( .t. )
::oUI:q_editSec5:setReadOnly( .t. )
::pushThemesData()
::connectSlots()
::pushThemesData()
RETURN Self
/*----------------------------------------------------------------------*/
@@ -1355,7 +1373,11 @@ METHOD IdeSetup:execEvent( cEvent, p, p1 )
::oUI:q_listThemes:setCurrentRow( len( ::oINI:aAppThemes ) - 1 )
ENDIF
EXIT
CASE "buttonThmCpy_clicked"
CASE "buttonThmApp_clicked"
IF ( n := ::oUI:q_listThemes:currentRow() ) > -1
hbide_setAppTheme( ::getThemeData( n + 1 ) )
::oDK:animateComponents( HBIDE_ANIMATION_GRADIENT )
ENDIF
EXIT
CASE "buttonThmDel_clicked"
EXIT
@@ -1375,14 +1397,18 @@ METHOD IdeSetup:execEvent( cEvent, p, p1 )
METHOD IdeSetup:pushThemesData()
LOCAL s, a_, qItem
FOR EACH s IN ::oINI:aAppThemes
a_:= hb_aTokens( s, "," )
qItem := QListWidgetItem():new()
qItem:setText( a_[ 1 ] )
::oUI:q_listThemes:addItem_1( qItem )
::pushThemeColors( s:__enumIndex() )
NEXT
IF ::nCurThemeSlot == 0
FOR EACH s IN ::oINI:aAppThemes
a_:= hb_aTokens( s, "," )
qItem := QListWidgetItem():new()
qItem:setText( a_[ 1 ] )
::oUI:q_listThemes:addItem_1( qItem )
::pushThemeColors( s:__enumIndex() )
NEXT
ENDIF
IF !empty( ::oINI:aAppThemes )
::oUI:q_listThemes:setCurrentRow( -1 )
::oUI:q_listThemes:setCurrentRow( len( ::oINI:aAppThemes ) - 1 )
::oUI:q_listThemes:setCurrentRow( 0 )
ENDIF
::oUI:q_radioSec1:click()
@@ -1391,6 +1417,23 @@ METHOD IdeSetup:pushThemesData()
/*------------------------------------------------------------------------*/
METHOD IdeSetup:getThemeData( nTheme )
LOCAL a_, i, aTheme := {}
IF nTheme >= 1 .AND. nTheme <= len( ::oINI:aAppThemes )
a_:= hbide_parseThemeComponent( ::oINI:aAppThemes[ nTheme ] )
FOR i := 2 TO 6
IF !empty( a_[ i ] )
aadd( aTheme, a_[ i ] )
ENDIF
NEXT
ENDIF
RETURN aTheme
/*----------------------------------------------------------------------*/
METHOD IdeSetup:pushThemeColors( nTheme )
LOCAL n, a_, i, aRGB, nSlot
@@ -1412,6 +1455,7 @@ METHOD IdeSetup:pushThemeColors( nTheme )
n := val( n )
NEXT
{ ::oUI:q_editSec1, ::oUI:q_editSec2, ::oUI:q_editSec3, ::oUI:q_editSec4, ::oUI:q_editSec5 }[ nSlot ]:setText( hb_ntos( aRGB[ 1 ] ) )
::populateThemeColors( nSlot, { aRGB[ 2 ], aRGB[ 3 ], aRGB[ 4 ] } )
ENDIF
NEXT
@@ -1423,11 +1467,15 @@ METHOD IdeSetup:pushThemeColors( nTheme )
/*------------------------------------------------------------------------*/
METHOD IdeSetup:populateThemeColors( nSlot, aRGB )
LOCAL qFrame
{ ::oUI:q_editR1, ::oUI:q_editR2, ::oUI:q_editR3, ::oUI:q_editR4, ::oUI:q_editR5 }[ nSlot ]:setText( hb_ntos( aRGB[ 1 ] ) )
{ ::oUI:q_editG1, ::oUI:q_editG2, ::oUI:q_editG3, ::oUI:q_editG4, ::oUI:q_editG5 }[ nSlot ]:setText( hb_ntos( aRGB[ 2 ] ) )
{ ::oUI:q_editB1, ::oUI:q_editB2, ::oUI:q_editB3, ::oUI:q_editB4, ::oUI:q_editB5 }[ nSlot ]:setText( hb_ntos( aRGB[ 3 ] ) )
qFrame := { ::oUI:q_frameSec1, ::oUI:q_frameSec2, ::oUI:q_frameSec3, ::oUI:q_frameSec4, ::oUI:q_frameSec5 }[ nSlot ]
qFrame:setStyleSheet( "background-color: " + hbide_rgbString( aRGB ) + ";" )
RETURN Self
/*------------------------------------------------------------------------*/

View File

@@ -69,6 +69,17 @@
/*----------------------------------------------------------------------*/
FUNCTION hbide_setAppTheme( aTheme )
LOCAL oTheme
STATIC sTheme
oTheme := sTheme
IF hb_isArray( aTheme )
sTheme := aTheme
ENDIF
RETURN oTheme
/*----------------------------------------------------------------------*/
FUNCTION GetStyleSheet( cWidget, nMode )
LOCAL txt_:= {}
LOCAL s := ""
@@ -487,7 +498,11 @@ STATIC FUNCTION hbide_loadIdeTheme( nTheme )
//
DO CASE
CASE nTheme == 1
RETURN { {0,255,255,255}, {0.25,219,230,244}, {0.5,201,217,237}, {0.75,231,242,255} }
IF empty( hbide_setAppTheme() )
RETURN { {0,255,255,255}, {0.25,219,230,244}, {0.5,201,217,237}, {0.75,231,242,255} }
ELSE
RETURN hbide_setAppTheme()
ENDIF
CASE nTheme == 2
RETURN { {0,173,185,207}, {1,199,212,231} }
ENDCASE

View File

@@ -1649,6 +1649,9 @@
<height>123</height>
</rect>
</property>
<property name="toolTip">
<string>Horizontal Gradient</string>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
@@ -1665,6 +1668,9 @@
<height>123</height>
</rect>
</property>
<property name="toolTip">
<string>Vertical Gradient</string>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
@@ -1693,6 +1699,9 @@
<height>20</height>
</rect>
</property>
<property name="toolTip">
<string>Section at ? ( less than 1 )</string>
</property>
</widget>
<widget class="QLineEdit" name="editSec1">
<property name="geometry">
@@ -1703,6 +1712,9 @@
<height>20</height>
</rect>
</property>
<property name="toolTip">
<string>Section at 0 edge</string>
</property>
</widget>
<widget class="QLineEdit" name="editSec2">
<property name="geometry">
@@ -1713,6 +1725,9 @@
<height>20</height>
</rect>
</property>
<property name="toolTip">
<string>Section at ? ( less than 1 )</string>
</property>
</widget>
<widget class="QLineEdit" name="editSec4">
<property name="geometry">
@@ -1723,6 +1738,9 @@
<height>20</height>
</rect>
</property>
<property name="toolTip">
<string>Section at ? ( less than 1 )</string>
</property>
</widget>
<widget class="QLineEdit" name="editSec3">
<property name="geometry">
@@ -1733,6 +1751,9 @@
<height>20</height>
</rect>
</property>
<property name="toolTip">
<string>Section at ? ( less than 1 )</string>
</property>
</widget>
<widget class="QLabel" name="label_19">
<property name="geometry">
@@ -2023,6 +2044,9 @@
<height>20</height>
</rect>
</property>
<property name="toolTip">
<string>Color at Section 1</string>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
@@ -2039,6 +2063,9 @@
<height>20</height>
</rect>
</property>
<property name="toolTip">
<string>Color at Section 1</string>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
@@ -2055,6 +2082,9 @@
<height>20</height>
</rect>
</property>
<property name="toolTip">
<string>Color at Section 2</string>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
@@ -2071,6 +2101,9 @@
<height>20</height>
</rect>
</property>
<property name="toolTip">
<string>Color at Section 4</string>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
@@ -2087,6 +2120,9 @@
<height>20</height>
</rect>
</property>
<property name="toolTip">
<string>Color at Section 5</string>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
@@ -2182,6 +2218,9 @@
<height>20</height>
</rect>
</property>
<property name="toolTip">
<string>Add a new theme</string>
</property>
<property name="text">
<string>...</string>
</property>
@@ -2195,19 +2234,25 @@
<height>20</height>
</rect>
</property>
<property name="toolTip">
<string>Delete current highlighted theme</string>
</property>
<property name="text">
<string>...</string>
</property>
</widget>
<widget class="QToolButton" name="buttonThmCpy">
<widget class="QToolButton" name="buttonThmApp">
<property name="geometry">
<rect>
<x>114</x>
<y>58</y>
<y>72</y>
<width>25</width>
<height>20</height>
</rect>
</property>
<property name="toolTip">
<string>Apply theme to application</string>
</property>
<property name="text">
<string>...</string>
</property>
@@ -2221,6 +2266,9 @@
<height>20</height>
</rect>
</property>
<property name="toolTip">
<string>Save current theme</string>
</property>
<property name="text">
<string>...</string>
</property>