Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sun 23 Apr 2017, 01:35
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Eye Candy
Theme (Gtk-2) features in detail, revisited.
Post new topic   Reply to topic View previous topic :: View next topic
Page 2 of 2 [17 Posts]   Goto page: Previous 1, 2
Author Message
torm


Joined: 07 Mar 2015
Posts: 85

PostPosted: Fri 21 Apr 2017, 12:26    Post subject:  

GtkCalendar details.

It is possible to theme GtkCalendar widget.
Also if a program uses some unique namespace, it can be accessed directly from
global gtkrc, aside from "class" level design of GtkCalendar.

Note that using different font or dpi will reshape the window to a different size.
For GtkCalendar widget it is okay to use any .ttf font that is installed on the system.
The example style has all the detail comments.


Code:
style "gtk_calendar_example"
{
   xthickness = 8            # border width
   ythickness = 8            # border height
   font_name = "Fjalla One 9"   # TTF fontname, number 9 stands for fontsize

   fg[NORMAL] = "#FFFFFF"      # month, year -text
   bg[NORMAL] = "#434343"      # month, year, arrow -backg. ; leading/next-month dates-text ; window border
   bg[PRELIGHT] = "#434343"   # arrow -backg., with mouse-over
   bg[ACTIVE] = "#434343"      # arrow -backg., clicking

   text[NORMAL] = "#CCCCCC"   # dates -text
   base[NORMAL] = "#000000"   # dates -backg.
   text[SELECTED] = "#FFFFFF"   # weekday-names, clicked-date -text
   base[SELECTED] = "#26282E"   # weekday-names, clicked-date -backg.
   text[ACTIVE] = "#FFFFFF"   # may appear... for weekday-names
   base[ACTIVE] = "#000000"   #               if clicking outside of calendar area

 engine "pixmap"
 {
   image
   {
   function   = SHADOW      # outer border
   detail      = "calendar"
   recolorable   = FALSE
   shadow      = IN
   file      = "cb_1.png"
   border      = { 8, 8, 8, 8} # notice border width/height above..
   stretch      = TRUE
   }
   image
   {
   function   = SHADOW      # month, year border
   detail      = "calendar"
   recolorable   = FALSE
   shadow      = OUT
   file      = "cb_2.png"
   border      = { 3, 3, 3, 3} # to bring inner borders together..
   stretch      = TRUE
   }
   image
   {
   function   = FOCUS         # clicked date border, must be transparent on the inside
   detail      = "calendar-day"
   file      = "cf_1.png"
   border      = { 2, 2, 2, 2}
   stretch      = TRUE
   }
   image
   {
   function   = ARROW         # arrow size is 8x8 pixel for this theme
   detail      = "calendar"
   state      = NORMAL      # states are: normal and prelight ( same for active/selected )
   file      = "arn.png"
   border      = { 1, 1, 1, 1}
   stretch      = TRUE
   arrow_direction   = RIGHT
   }
   image
   {
   function   = ARROW
   detail      = "calendar"
   state      = NORMAL
   file      = "aln.png"
   border      = { 1, 1, 1, 1}
   stretch      = TRUE
   arrow_direction   = LEFT
   }
   image
   {
   function   = ARROW
   detail      = "calendar"
   state      = PRELIGHT
   file      = "arp.png"
   border      = { 1, 1, 1, 1}
   stretch      = TRUE
   arrow_direction   = RIGHT
   }
   image
   {
   function   = ARROW
   detail      = "calendar"
   state      = PRELIGHT
   file      = "alp.png"
   border      = { 1, 1, 1, 1}
   stretch      = TRUE
   arrow_direction   = LEFT
   }
 }
}
class "GtkCalendar" style "gtk_calendar_example"




Screenshot shows gsimplecal with different themes, appearing on BMPanel2 click above clock.
gtkcalendar-examples.png
 Description   
 Filesize   36.35 KB
 Viewed   44 Time(s)

gtkcalendar-examples.png

Back to top
View user's profile Send private message 
torm


Joined: 07 Mar 2015
Posts: 85

PostPosted: Fri 21 Apr 2017, 12:35    Post subject:  

Below is a .pet package of gsimplecal-v2.1 precompiled for tahrpup605(32bit) with Gtk-2
and configured settings to look/act the same as on screenshot.
Executable is modified to have direct theme support from global gtkrc, so it
can have any look possible -without altering any other widget or application that
uses GtkCalendar widget.
gsimplecal will install to "my-applications/bin" folder, documentation like
README and example sub-theme.rc will go in "my-documents" folder, under "gsimplecal_plus".
Setting to current locale should be automatic (including week-start-day, etc. ) .
If selected font does not support locale glyphs, edit sub-theme.rc to use some
other font that does.
Double-clicking on calendar dates-area will bring up "Osmo" and close calendar.
To use with BMPanel2 add to bmpanel2rc ( in /root/.config/bmpanel2/.. ) a simple line:
clock_prog gsimplecal
For JWM change in /root/.jwmrc-tray from: <Clock format="%H:%M">PupClockset</Clock>
to: <Clock format="%H:%M">gsimplecal</Clock>

Please read the manual for more options.
When in doupt, use gsimplecal version provided in PPM of your flavor of PuppyLinuxOS.


-------------
CHANGELOG for gsimplecal mod.
-------------

MainWindow.cpp as line 101 added:
Code:
    gtk_widget_set_name(widget, "gsimplecal");


Calendar.cpp as line 37 added:
Code:
    gtk_widget_set_name(widget, "gsimplecalendar");


-------------
When compiling it from source, try:
./configure --enable-gtk2

------------------------------------------------

Mainwindow widget will appear if "show_timezones" is set to "1" and so there can be
a different look for font/color/bg of that item.
I don't think the clock label will update...

------------------------------------------------

Configuration file should be installed as /root/.config/gsimplecal/config

clock_format =%A %x
-notice extra whitespace after "%A" ?
-typing in terminal:
date --help
..will list all possible formats to use
-typing in terminal:
man gsimplecal
..should open the gsimplecal manual for more details

------------------------------------------------

To use included calendar sub-theme, copy the "calendar" folder to whatever theme in
/usr/share/themes/whatever-theme-name/gtk-2.0/..
then open the gtkrc of that theme and add at the top:
include "calendar/sub-theme.rc"
..and re-select the theme.

Note.
When editing the look of calendar, changes may appear without the need to restart
the gtk2 theme in the middle of process, just restart the calendar for that.
When done, don't forget to re-select the gtk2 theme Wink


PS.
Fjalla One.ttf and TekoRegular.ttf fonts are included in "fonts.pet" package in one of
previous posts.
gsimplecal.pet
Description 
pet

 Download 
Filename  gsimplecal.pet 
Filesize  21.3 KB 
Downloaded  2 Time(s) 
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 2 of 2 [17 Posts]   Goto page: Previous 1, 2
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Eye Candy
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0672s ][ Queries: 15 (0.0170s) ][ GZIP on ]