It is currently Sun Aug 02, 2026 9:00 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 64 posts ]  Go to page Previous  1, 2, 3, 4  Next
Author Message
 Post subject: Re: GIMP Themes - Getting Started
PostPosted: Mon Jun 16, 2014 7:40 am  (#21) 
Offline
Script Coder
User avatar

Joined: Jun 22, 2010
Posts: 1171
Location: Here and there
Hallo abraess,

I'm not sure I understand what you are saying.

Your screenshot shows the menu background (bg[NORMAL]) is "pink" and the foreground (fg[NORMAL]) is magenta.

The item that is showing the tool-tip, Sichtbares kopieren, in English "Copy Visible", is currently disabled and it's colour is being set by the fg[INSENSITIVE] colour from the gimp-default-style, which on my gtkrc is set to "lighter (@fg_color)":
Attachment:
Untitled.png
Untitled.png [ 80.36 KiB | Viewed 7574 times ]


You can add a fg[INSENSITIVE] to the "menu" style to change it: eg:
  fg[NORMAL] = "magenta"
  fg[PRELIGHT] = "darkblue"
  fg[INSENSITIVE] = "green"
  bg[NORMAL] = "pink"
  bg[PRELIGHT] = "black"


Kevin


Top
 Post subject: Re: GIMP Themes - Getting Started
PostPosted: Tue Jun 17, 2014 7:22 am  (#22) 
Offline
Script Coder
User avatar

Joined: Jun 22, 2010
Posts: 1171
Location: Here and there
While we're on the subject of styling the menus/menubar, I'll show you how to apply a background image like the ones Mikechat is so keen to show us.

There are a couple of ways to do this.

You can add a bg_pixmap[NORMAL] entry to your style:
style "menu" = "gimp-default-style"
{
  fg[NORMAL] = "blue"
  fg[PRELIGHT] = "#FF0000"
  bg[NORMAL] = "yellow"
  bg[PRELIGHT] = "green"
  xthickness = 1
  ythickness = 4
  bg_pixmap[NORMAL] = "bg.png"
}
This will tile the background image onto your menu. If the image is bigger than the menu, you will only get the part of the image that fits. Note that this can be applied to any style, including the gimp-default-style.

The alternative method allows some more control:
style "menu" = "gimp-default-style"
{
  fg[NORMAL] = "blue"
  fg[PRELIGHT] = "#FF0000"
  bg[NORMAL] = "yellow"
  bg[PRELIGHT] = "green"
  xthickness = 1
  ythickness = 4
  engine "pixmap"
  {
    image
    {
      function      = BOX
      detail      = "menu"
      file      = "/menus/menu_bg.png"          # image for the background of drop-down menus
      border      = { 0, 0, 0, 0}
      stretch      = FALSE
    }
  }
}
Here we are using the "pixmap" rendering engine to apply the image. The control we have is to specify if the image should be tiled or distorted to fit the available space as demonstrated by Mikechat's examples.
Setting the stretch parameter to FALSE means the image will be tiled. TRUE means it will be distorted to fit.

In addition we have the border parameter. This specifies how much of the edges must not be stretched, in the order Left, Right, Top, Bottom. This is best illustrated with an example:
Attachment:
gimp_menu_image.png
gimp_menu_image.png [ 121.54 KiB | Viewed 7560 times ]

Here I have used a partly transparent image (see menu_bg.png attached) with 1 pixel borders
and have specified the border parameter as {1, 0, 0, 0} so 1 pixel of the left edge is not stretched but the other borders are.

I have used a partly transparent image for the background to show how the background colour shows through, which is a way of making the theme common across the widgets without having to edit all the images for each widget when you change the colours.

Kevin


Attachments:
menu_bg.png
menu_bg.png [ 503 Bytes | Viewed 7560 times ]
Top
 Post subject: Re: GIMP Themes - Getting Started
PostPosted: Tue Jun 17, 2014 10:37 am  (#23) 
Offline
GimpChat Member

Joined: Oct 02, 2010
Posts: 106
Hallo Kevin,
I try second code but after I put in rc_menu.rc it look not like your even closely. The green in Border in Menu tab get also no my menu tab stay grey like show in last picture. Thank you


Top
 Post subject: Re: GIMP Themes - Getting Started
PostPosted: Tue Jun 17, 2014 10:52 am  (#24) 
Offline
Script Coder
User avatar

Joined: Jun 22, 2010
Posts: 1171
Location: Here and there
Hi abraess,

There are two ways I can think of to find the problem, either you zip your theme folder up, attach it to a post and I (or anyone else who wants to help) has a look, or I post my theme so far and you compare it with what you have done.

So I have attached my theme as it it now and if you want us to look at yours, just attach it.

Kevin

p.s. I have changed the name of the folder so it won't over-write anything you have done so far if you have kept the original name.


Attachments:
Theme-Test-2.zip [50.04 KiB]
Downloaded 327 times
Top
 Post subject: Re: GIMP Themes - Getting Started
PostPosted: Tue Jun 17, 2014 12:07 pm  (#25) 
Offline
GimpChat Member

Joined: Oct 02, 2010
Posts: 106
Thank I will compare it with my. If I find not my mistake i will pack my and attach it. Byway I have change the folder name that I have good name if I'm finish.
Thank you

I know now hat was worng I copy first code there was stretch = FALSE with stretch = TURE look reight


Top
 Post subject: Re: GIMP Themes - Getting Started
PostPosted: Wed Jun 18, 2014 6:08 am  (#26) 
Offline
Script Coder
User avatar

Joined: Jun 22, 2010
Posts: 1171
Location: Here and there
Now let's move onto buttons.

I have put the styling for buttons into the rc_buttons.rc file and pulled it into the gtkrc using import "rc_buttons.rc"

Buttons are styled using a set of images, one for each state of the button:
Attachment:
gimp_buttons.png
gimp_buttons.png [ 9.76 KiB | Viewed 7517 times ]
Here I have made button images that are transparent just to keep the theme modification simple again.

The code in rc_buttons.rc looks like this:
style "buttons"
{
  engine "pixmap"
  {
    image
    {
      function   = BOX
      detail   = "buttondefault"
      file      = "/buttons/button-default.png"  # used to indicate which button will be activated when the Return key is pressed
      border   = { 2, 2, 2, 2} # how much of the image should not be stretched (L, R, T, B)
      stretch   = TRUE
    }

    image
    {
      function   = BOX
      state      = NORMAL
      file      = "/buttons/button-normal.png"          # image for a button
      border   = { 2, 2, 2, 2}
      stretch   = TRUE
    }

    image
    {
      function   = BOX
      state      = PRELIGHT
      shadow   = OUT
      file      = "/buttons/button-prelight.png"      # image for a hovered-over button
      border   = { 2, 2, 2, 2}
      stretch   = TRUE
    }

    image
    {
      function   = BOX
      state      = PRELIGHT
      shadow   = IN
      file      = "/buttons/button-active-prelight.png"  # Don't know
      border   = { 2, 2, 2, 2}
      stretch   = TRUE
    }

    image
    {
      function   = BOX
      state      = INSENSITIVE
      file      = "/buttons/button-inactive.png"    # image for an inactive (i.e. disabled) button
      border   = { 2, 2, 2, 2}
      stretch   = TRUE
    }

    image
    {
      function   = BOX
      state      = ACTIVE
      file      = "/buttons/button-active.png"      # Image for button when pressed
      border   = { 2, 2, 2, 2}
      stretch   = TRUE
    }
  }
}
So for each of the states of the buttons, there is an image file defined. Note that there is one state I haven't created an image file for: button-active-prelight.png as I don't know of any circumstance where it is possible for this state to be reached.

You can see that I have defined the borders to be 2,2,2,2 because that is how much bevelled edge each button image has and I don't want those to be stretched.

I have also modified the button_default.png from the version in the theme I have supplied to make it possible to see when it is being used:
Attachment:
button_file_new.png
button_file_new.png [ 23.08 KiB | Viewed 7517 times ]

You can see the OK button has extra detail because the button-default image is being applied as well as the button-normal image.

If you have a look at Warrior's Teal Appeal theme you can see the buttons can be much more elaborate than I have done here.

You will also see that buttons are used in many places - for the tools in the toolbox, for the colour patches on the colour picker etc. and can be individually styled if you can find the right combination for the style application:
class "GtkButton"               style "buttons"

Only want to style the buttons on the toolbox?:
widget_class "*Tool*Button*"            style "buttons"

Only want to style the buttons on dialog windows?:
widget_class "*Dialog*Button*"            style "buttons"


Kevin


Top
 Post subject: Re: GIMP Themes - Getting Started
PostPosted: Thu Jun 19, 2014 11:35 am  (#27) 
Offline
Script Coder
User avatar

Joined: Jun 22, 2010
Posts: 1171
Location: Here and there
Today it's the turn of Check-Boxes and Radio Buttons.

As they are very similar, I'll just show the code for the Check-Boxes, but here's the example to show the images I have created for this theme:
Attachment:
Untitled.png
Untitled.png [ 58.68 KiB | Viewed 7499 times ]


The code in rc_checkbuttons.rc is this:
style "checkbuttons" = "gimp-default-style"
{
  engine "pixmap"
  {
    image
    {
      function         = CHECK
      state            = NORMAL
      shadow         = OUT
      overlay_file      = "/checkbuttons/check-norm-unchecked.png" # image for unchecked check button
      overlay_stretch   = TRUE      # set TRUE to get GtkCheckButton::indicator-size to be used
    }

    image
    {
      function         = CHECK
      state            = PRELIGHT
      shadow         = OUT
      overlay_file      = "/checkbuttons/check-prelight-unchecked.png" # image for hovered-over unchecked check button
      overlay_stretch   = TRUE
    }

    image
    {
      function         = CHECK
      state            = ACTIVE
      shadow         = OUT
      overlay_file      = "/checkbuttons/check-norm-unchecked.png" # image for unchecked check button when being clicked
      overlay_stretch   = TRUE
    }

    image
    {
      function         = CHECK
      state            = INSENSITIVE
      shadow         = OUT
      overlay_file      = "/checkbuttons/check-insens-unchecked.png" # image for unchecked disabled check button
      overlay_stretch   = TRUE
    }

    image
    {
      function         = CHECK
      recolorable      = TRUE
      state            = NORMAL
      shadow         = IN
      overlay_file      = "/checkbuttons/check-norm-checked.png" # image for checked check button
      overlay_stretch   = TRUE
    }

    image
    {
      function         = CHECK
      recolorable      = TRUE
      state            = PRELIGHT
      shadow         = IN
      overlay_file      = "/checkbuttons/check-prelight-checked.png" # image for hovered-over checked check button
      overlay_stretch   = TRUE
    }

    image
    {
      function         = CHECK
      recolorable      = TRUE
      state            = ACTIVE
      shadow         = IN
      overlay_file      = "/checkbuttons/check-prelight-checked.png" # image for clicked checked check button
      overlay_stretch   = TRUE
    }

    image
    {
      function         = CHECK
      recolorable      = TRUE
      state            = INSENSITIVE
      shadow         = IN
      overlay_file      = "/checkbuttons/check-insens-checked.png" # image for disabled checked check button
      overlay_stretch   = TRUE
    }

    image
    {
      function      = FLAT_BOX
      recolorable   = TRUE
      file         = "/checkbuttons/checklight.png" # Used to create a highlight for the whole widget (including label)
      border      = { 1, 1, 1, 1}
      stretch      = TRUE
    }
  }
}
As with the buttons it's just a case of pointing to the various images for each of the states. Here we also have the checklight.png which is used to highlight the current button in the same was as the PRELIGHT state. In fact if you remove that image, you get the standard PRELIGHT states for the text.

As these were not included in the theme I have attached the latest version.

Finally, is there anyone following this, or am I talking to myself ;)

Kevin


Attachments:
Theme-Test-3.zip [61.16 KiB]
Downloaded 303 times
Top
 Post subject: Re: GIMP Themes - Getting Started
PostPosted: Thu Jun 19, 2014 12:38 pm  (#28) 
Offline
GimpChat Member
User avatar

Joined: Apr 07, 2010
Posts: 14182
Thank you Kevin.

_________________
Image


Top
 Post subject: Re: GIMP Themes - Getting Started
PostPosted: Thu Jun 19, 2014 7:44 pm  (#29) 
Offline
GimpChat Member

Joined: May 23, 2012
Posts: 150
Image

we are reading great work,
but give me some time
to drink a beer.
thank you Kevin!


Top
 Post subject: Re: GIMP Themes - Getting Started
PostPosted: Thu Jun 19, 2014 8:05 pm  (#30) 
Offline
GimpChat Member

Joined: May 23, 2012
Posts: 150
Image

well that last post was all about Kevin
maybe i should one about me if
it don't offend you.


Top
 Post subject: Re: GIMP Themes - Getting Started
PostPosted: Fri Jun 20, 2014 3:32 am  (#31) 
Offline
Script Coder
User avatar

Joined: Jun 22, 2010
Posts: 1171
Location: Here and there
Mikechat wrote:
well that last post was all about Kevin
maybe i should one about me if
it don't offend you.


No problem and I hope it was a good beer you were enjoying :)

Kevin


Coming soon... Scrollbars


Top
 Post subject: Re: GIMP Themes - Getting Started
PostPosted: Fri Jun 20, 2014 7:09 am  (#32) 
Offline
Script Coder
User avatar

Joined: Jun 22, 2010
Posts: 1171
Location: Here and there
Scrollbars

These are made from several elements, each of which can be styled and have can have different images for each of the standard states.

Here is a image to point out the various elements:

Attachment:
gimp_scrollbars.png
gimp_scrollbars.png [ 574.26 KiB | Viewed 10211 times ]


And the associated code in rc_scrollbars.rc is this:
style "scrollbars" = "gimp-default-style" # For scrollbars - for example the Image window scrollbars
{
  engine "pixmap"
  {
    image
    {
      function      = BOX
      recolorable   = TRUE
      detail      = "trough"
      file         = "/scrollbars/trough-scrollbar-horiz.png"
      border      = { 1, 1, 1, 1}
      stretch      = TRUE
      orientation   = HORIZONTAL
    }

    image
    {
      function      = BOX
      recolorable   = TRUE
      detail      = "trough"
      file         = "/scrollbars/trough-scrollbar-vert.png"
      border      = { 1, 1, 1, 1}
      stretch      = TRUE
      orientation   = VERTICAL
    }

    image
    {
      function      = SLIDER
      recolorable   = TRUE
      state         = NORMAL
      file         = "/scrollbars/slider-normal.png"
      border      = { 2, 2, 2, 2}
      stretch      = TRUE
      orientation   = HORIZONTAL
    }

    image
    {
      function      = SLIDER
      recolorable   = TRUE
      state         = PRELIGHT
      file         = "/scrollbars/slider-prelight.png"
      border      = { 2, 2, 2, 2}
      stretch      = TRUE
      overlay_file      = "/scrollbars/slider-horiz-over.png"
      overlay_border   = { 2, 2, 2, 2}
      overlay_stretch   = FALSE
      orientation      = HORIZONTAL
    }

    image
    {
      function      = SLIDER
      recolorable   = TRUE
      state         = ACTIVE
      file         = "/scrollbars/slider-prelight.png"
      border      = { 2, 2, 2, 2}
      stretch      = TRUE
      orientation   = HORIZONTAL
    }

    image
    {
      function      = SLIDER
      recolorable   = TRUE
      state         = INSENSITIVE
      file         = "/scrollbars/slider-insensitive.png"
      border      = { 2, 2, 2, 2}
      stretch      = TRUE
      orientation   = HORIZONTAL
    }

    image
    {
      function      = SLIDER
      recolorable   = TRUE
      state         = NORMAL
      file         = "/scrollbars/slider-normal.png"
      border      = { 2, 2, 2, 2}
      stretch      = TRUE
      orientation   = VERTICAL
    }

    image
    {
      function      = SLIDER
      recolorable   = TRUE
      state         = PRELIGHT
      file         = "/scrollbars/slider-prelight.png"
      border      = { 2, 2, 2, 2}
      stretch      = TRUE
      overlay_file      = "/scrollbars/slider-vert-over.png"
      overlay_border   = { 2, 2, 2, 2}
      overlay_stretch   = FALSE
      orientation      = VERTICAL
    }

    image
    {
      function      = SLIDER
      recolorable   = TRUE
      state         = ACTIVE
      file         = "/scrollbars/slider-prelight.png"
      border      = { 2, 2, 2, 2}
      stretch      = TRUE
      orientation   = VERTICAL
    }

    image
    {
      function      = SLIDER
      recolorable   = TRUE
      state         = INSENSITIVE
      file         = "/scrollbars/slider-insensitive.png"
      border      = { 2, 2, 2, 2}
      stretch      = TRUE
      orientation   = VERTICAL
    }


    image
    {
      function         = STEPPER
      recolorable      = TRUE
      state            = NORMAL
      file            = "/scrollbars/stepper-up.png"
      stretch         = TRUE
      arrow_direction   = UP
    }

    image
    {
      function         = STEPPER
      recolorable      = TRUE
      state            = PRELIGHT
      file            = "/scrollbars/stepper-up-prelight.png"
      stretch         = TRUE
      arrow_direction   = UP
    }

    image
    {
      function         = STEPPER
      recolorable      = TRUE
      state            = ACTIVE
      file            = "/scrollbars/stepper-up-prelight.png"
      stretch         = TRUE
      arrow_direction   = UP
    }

    image
    {
      function         = STEPPER
      recolorable      = TRUE
      state            = INSENSITIVE
      file            = "/scrollbars/stepper-up-insensitive.png"
      stretch         = TRUE
      arrow_direction   = UP
    }

    image
    {
      function         = STEPPER
      recolorable      = TRUE
      state            = NORMAL
      file            = "/scrollbars/stepper-down.png"
      stretch         = TRUE
      arrow_direction   = DOWN
    }

    image
    {
      function         = STEPPER
      recolorable      = TRUE
      state            = PRELIGHT
      file            = "/scrollbars/stepper-down-prelight.png"
      stretch         = TRUE
      arrow_direction   = DOWN
    }

    image
    {
      function         = STEPPER
      recolorable      = TRUE
      state            = ACTIVE
      file            = "/scrollbars/stepper-down-prelight.png"
      stretch         = TRUE
      arrow_direction   = DOWN
    }

    image
    {
      function         = STEPPER
      recolorable      = TRUE
      state            = INSENSITIVE
      file            = "/scrollbars/stepper-down-insensitive.png"
      stretch         = TRUE
      arrow_direction   = DOWN
    }

    image
    {
      function         = STEPPER
      recolorable      = TRUE
      state            = NORMAL
      file            = "/scrollbars/stepper-left.png"
      stretch         = TRUE
      arrow_direction   = LEFT
    }

    image
    {
      function         = STEPPER
      recolorable      = TRUE
      state            = PRELIGHT
      file            = "/scrollbars/stepper-left-prelight.png"
      stretch         = TRUE
      arrow_direction   = LEFT
    }

    image
    {
      function         = STEPPER
      recolorable      = TRUE
      state            = ACTIVE
      file            = "/scrollbars/stepper-left-prelight.png"
      stretch         = TRUE
      arrow_direction   = LEFT
    }

    image
    {
      function         = STEPPER
      recolorable      = TRUE
      state            = INSENSITIVE
      file            = "/scrollbars/stepper-left.png"
      stretch         = TRUE
      arrow_direction   = LEFT
    }

    image
    {
      function         = STEPPER
      recolorable      = TRUE
      state            = NORMAL
      file            = "/scrollbars/stepper-right.png"
      stretch         = TRUE
      arrow_direction   = RIGHT
    }

    image
    {
      function         = STEPPER
      recolorable      = TRUE
      state            = PRELIGHT
      file            = "/scrollbars/stepper-right-prelight.png"
      stretch         = TRUE
      arrow_direction   = RIGHT
    }

    image
    {
      function         = STEPPER
      recolorable      = TRUE
      state            = ACTIVE
      file            = "/scrollbars/stepper-right-prelight.png"
      stretch         = TRUE
      arrow_direction   = RIGHT
    }

    image
    {
      function         = STEPPER
      recolorable      = TRUE
      state            = INSENSITIVE
      file            = "/scrollbars/stepper-right-insensitive.png"
      stretch         = TRUE
      arrow_direction   = RIGHT
    }
  }
}

In addtion to the images, some other properties can be specified. For example:
GtkScrollbar::min-slider-length   = 30
At this point it's worth pointing out the GTK documentation, in this case for GtkScrollbar: https://developer.gnome.org/gtk2/2.24/GtkScrollbar.html which lists the style properties specific to this widget.

It should also be noted that it inherits style properties from it's parent widget GtkRange: https://developer.gnome.org/gtk2/2.24/GtkRange.html so you can also specify those properties for the scrollbars:
GtkScrollbar::slider-width = 50


Kevin


Top
 Post subject: Re: GIMP Themes - Getting Started
PostPosted: Mon Jun 23, 2014 11:12 am  (#33) 
Offline
Script Coder
User avatar

Joined: Jun 22, 2010
Posts: 1171
Location: Here and there
Today it's tabs:

In the GTK world - tabbed widgets are known as Notebooks

They are used in GIMP for the docked windows in the toolbox:
Attachment:
gimp-tabs-toolbox.png
gimp-tabs-toolbox.png [ 11.78 KiB | Viewed 10189 times ]


But here I'm using the Filters>>Map>>Map Object dialog as it's slightly clearer:
Attachment:
gimp-tabs-map.png
gimp-tabs-map.png [ 85.91 KiB | Viewed 10189 times ]


The associated code in rc_tabs.rc:
# https://developer.gnome.org/gtk2/2.24/GtkNotebook.html
style "tabs" = "gimp-default-style"
{
  xthickness = 4
  ythickness = 4

  GtkNotebook::tab-curvature = 2  # sets horizonal padding internal to the tab
  GtkNotebook::tab-overlap = 0    # sets how much the tabs overlap

  engine "pixmap"
  {
    image
    {
      function   = EXTENSION
      state      = NORMAL
      gap_side   = BOTTOM
      file      = "/tabs/tab-top-active.png"  # used for active top tab widgets for examaple in "Map to Object"
      stretch   = TRUE
      border   = { 2, 2, 2, 2}
    }

    image
    {
      function   = EXTENSION
      state      = ACTIVE
      gap_side   = BOTTOM
      file      = "/tabs/tab-top-inactive.png" # background for inactive top tabs
      stretch   = TRUE
      border   = { 2, 2, 2, 2}
    }

    image
    {
      function         = BOX_GAP
      recolorable      = TRUE
      file            = "/tabs/notebook-top.png" # background for area containing tab page
      border         = { 1, 1, 1, 1}
      stretch         = TRUE
      gap_file         = "/tabs/gap-top-active.png" # line under active top tab
      gap_border        = { 1, 1, 0, 0}
      gap_start_file   = "/tabs/gap-start.png" # This is the top line of the paged area to the left of the active top tab
      gap_start_border   = { 0, 0, 0, 0}
      gap_end_file      = "/tabs/gap-end.png" # This is the top line of the paged area to the right of the active top tab
      gap_end_border   = { 0, 0, 0, 0}
      gap_side         = TOP
    }


  # the bottom, left and right tab orientations aren't used in GIMP
    image
    {
      function   = EXTENSION
      state      = NORMAL
      gap_side   = TOP
      file      = "/tabs/tab-bottom-active.png" # used for active bottom tab widgets
      stretch   = TRUE
      border   = { 2, 2, 2, 2}
    }

    image
    {
      function   = EXTENSION
      state      = ACTIVE
      gap_side   = TOP
      file      = "/tabs/tab-bottom-inactive.png" # background for inactive bottom tabs
      stretch   = TRUE
      border   = { 2, 2, 2, 2}
    }

    image
    {
      function         = BOX_GAP
      recolorable      = TRUE
      file            = "/tabs/notebook-bottom.png"
      border         = { 1, 1, 1, 1}
      stretch         = TRUE
      gap_file         = "/tabs/gap-bottom-active.png" # line on top of active bottom tab
      gap_border        = { 1, 1, 0, 0}
      gap_start_file   = "/tabs/gap-start.png"
      gap_start_border   = { 0, 0, 0, 0}
      gap_end_file      = "/tabs/gap-end.png"
      gap_end_border   = { 0, 0, 0, 0}
      gap_side         = BOTTOM
    }

    image
    {
      function   = EXTENSION
      state      = NORMAL
      gap_side   = LEFT
      file      = "/tabs/tab-right-active.png"
      stretch   = TRUE
      border   = { 2, 2, 2, 2}
    }

    image
    {
      function   = EXTENSION
      state      = ACTIVE
      gap_side   = LEFT
      file      = "/tabs/tab-right-inactive.png"
      stretch   = TRUE
      border   = { 2, 2, 2, 2}
    }

    image
    {
      function         = BOX_GAP
      recolorable      = TRUE
      file            = "/tabs/notebook-right.png"
      border         = { 1, 1, 1, 1}
      stretch         = TRUE
      gap_file         = "/tabs/gap-right-active.png"
      gap_border        = { 1, 1, 0, 0}
      gap_start_file   = "/tabs/gap-start.png"
      gap_start_border   = { 0, 0, 0, 0}
      gap_end_file      = "/tabs/gap-end.png"
      gap_end_border   = { 0, 0, 0, 0}
      gap_side         = RIGHT
    }

    image
    {
      function   = EXTENSION
      state      = NORMAL
      gap_side   = RIGHT
      file      = "/tabs/tab-left-active.png"
      stretch   = TRUE
      border   = { 2, 2, 2, 2}
    }

    image
    {
      function   = EXTENSION
      state      = ACTIVE
      gap_side   = RIGHT
      file      = "/tabs/tab-left-inactive.png"
      stretch   = TRUE
      border   = { 2, 2, 2, 2}
    }

    image
    {
      function         = BOX_GAP
      recolorable      = TRUE
      file            = "/tabs/notebook-left.png"
      border         = { 1, 1, 1, 1}
      stretch         = TRUE
      gap_file         = "/tabs/gap-left-active.png"
      gap_border        = { 1, 1, 0, 0}
      gap_start_file   = "/tabs/gap-start.png"
      gap_start_border   = { 0, 0, 0, 0}
      gap_end_file      = "/tabs/gap-end.png"
      gap_end_border   = { 0, 0, 0, 0}
      gap_side         = LEFT
    }
  }
}
As far as I can see, only the top tab orientation is used in GIMP.

The GtkNotebook::tab-overlap = 0 controls how much the tabs overlap, and negative values will space them further apart.

Kevin

p.s. Because I learned some things preparing this I made some changes to the files, so I have attached the latest version.


Attachments:
Theme-Test-4.zip [75.95 KiB]
Downloaded 359 times
Top
 Post subject: Re: GIMP Themes - Getting Started
PostPosted: Mon Jun 23, 2014 2:52 pm  (#34) 
Offline
GimpChat Member
User avatar

Joined: Apr 07, 2010
Posts: 14182
Thank you Kevin, you put a lot of work in that one.

_________________
Image


Top
 Post subject: Re: GIMP Themes - Getting Started
PostPosted: Mon Jun 23, 2014 5:36 pm  (#35) 
Offline
GimpChat Member
User avatar

Joined: Apr 07, 2010
Posts: 14182
Nice job mikechat

_________________
Image


Top
 Post subject: Re: GIMP Themes - Getting Started
PostPosted: Wed Jul 30, 2014 11:22 am  (#36) 
Offline
GimpChat Member

Joined: Jul 29, 2014
Posts: 6
Thanks for this great tutorial! It got me started when I was about to give up.

I've been trying for the last two days to make my own theme, as I want to move from Photoshop to Gimp. I've come really far (I think) and have now reversed engineered a lot of code, although I have no clue how to read it. And made a lot of icons.

Now I'm stuck and can't change the look of the tool percentage sliders, as I can't find any examples on how to add images/colors/size/border etc to them.

If you could give me a hint I would be really grateful.


Attachments:
Simplicity-Light-Theme.jpg
Simplicity-Light-Theme.jpg [ 275.21 KiB | Viewed 10067 times ]
Top
 Post subject: Re: GIMP Themes - Getting Started
PostPosted: Thu Jul 31, 2014 3:45 am  (#37) 
Offline
Script Coder
User avatar

Joined: Jun 22, 2010
Posts: 1171
Location: Here and there
rheus wrote:
Thanks for this great tutorial! It got me started when I was about to give up.

I've been trying for the last two days to make my own theme, as I want to move from Photoshop to Gimp. I've come really far (I think) and have now reversed engineered a lot of code, although I have no clue how to read it. And made a lot of icons.

Now I'm stuck and can't change the look of the tool percentage sliders, as I can't find any examples on how to add images/colors/size/border etc to them.

If you could give me a hint I would be really grateful.


The problem with the GIMP 2.8 sliders is that they are a custom widget rather than a standard GTK widget. This will mean you will have to look in the source code to find out how they are made and there's no certainty that they are styleable at all (although the colours can be set)

I also notice while watching GIT commits go past that there will be a new rotation adjustment widget in 2.10, which will probably not be styleable either (other than colours ?)

Kevin

Edit: It appears that the sliders (AKA scale widgets) are slightly styleable, but I've not worked out the details yet:


Top
 Post subject: Re: GIMP Themes - Getting Started
PostPosted: Thu Jul 31, 2014 9:54 am  (#38) 
Offline
Script Coder
User avatar

Joined: Jun 22, 2010
Posts: 1171
Location: Here and there
I've done some experimenting and found that the sliders are GimpSpinScale widgets and I can do this to them:
Attachment:
gimpspinscale.png
gimpspinscale.png [ 8.66 KiB | Viewed 10029 times ]
using this code:
style "scale" = "gimp-default-style"
{
  fg[SELECTED]      = "white" # colour of label text when on top of the bar
  text[NORMAL]      = "red"   # colour of text when not on top of the bar - and the border???
  base[NORMAL]      = "cyan"  # background colour
  bg[SELECTED]       = "yellow"   # colour of bar when it's less than the minimum

  engine "pixmap"
  {
    image
    {
      function   = BOX
      file      = "/scale/scale_bg.png"
      border      = { 0, 1, 0, 0}
      stretch      = TRUE
      orientation   = HORIZONTAL
    }
  }
}
and the scale_bg.png image is this:
Attachment:
scale_bg.png
scale_bg.png [ 159 Bytes | Viewed 10029 times ]

I apply that style using this:
class "GimpSpinScale"             style "scale"


What I don't understand is why it stops drawing the bar using the image file when the bar is less than about 45 pixels wide. I'm going to try asking the developers: https://mail.gnome.org/archives/gimp-de ... 00074.html

Kevin


Top
 Post subject: Re: GIMP Themes - Getting Started
PostPosted: Thu Jul 31, 2014 10:26 am  (#39) 
Offline
GimpChat Member

Joined: Jul 29, 2014
Posts: 6
Quote:
The problem with the GIMP 2.8 sliders is that they are a custom widget rather than a standard GTK widget. This will mean you will have to look in the source code to find out how they are made and there's no certainty that they are styleable at all (although the colours can be set)

I also notice while watching GIT commits go past that there will be a new rotation adjustment widget in 2.10, which will probably not be styleable either (other than colours ?)

Kevin

Edit: It appears that the sliders (AKA scale widgets) are slightly styleable, but I've not worked out the details yet:


Thanks! The words "scale widgets" was the hint I needed.

class "GimpSpinScale" style "whatever"


EDIT: You should instead use:

widget "*GimpSpinScale"          style:highest "style-gimpspinscale"


This is starting to become a really fun project. The logic behind theme-ing GIMP, after a pretty steep learning curve, and very little documentation, is actually relatively simple.

Do you mind if I post more of my future discoveries here, if I find any?

Cheers, Roy.

EDIT:

Apparently "GtkSpinButton" works as well, though some other parts gets affected.


Last edited by rheus on Tue Aug 05, 2014 2:34 pm, edited 3 times in total.

Top
 Post subject: Re: GIMP Themes - Getting Started
PostPosted: Thu Jul 31, 2014 10:28 am  (#40) 
Offline
Script Coder
User avatar

Joined: Jun 22, 2010
Posts: 1171
Location: Here and there
rheus wrote:
Do you mind if I post more of my future discoveries here, if I find any?

Cheers, Roy.


Please do :)


Top
Post new topic Reply to topic  [ 64 posts ]  Go to page Previous  1, 2, 3, 4  Next

All times are UTC - 5 hours [ DST ]



* Login  



Powered by phpBB3 © phpBB Group