• Change padding with awthemes

    From meshparts@alexandru.dadalau@meshparts.de to comp.lang.tcl on Fri Mar 20 13:30:54 2026
    From Newsgroup: comp.lang.tcl

    I'm having issues with awthemes and awdark.
    The buttons padding is in most cases 0 and I want to reset it to
    original values.
    I could identify the settings (I think) in awthemes.tcl, where the
    *.padding properties are set, for example:

    set vars(names.colors.derived) { \
    other checkbutton.padding {5 0 1 2} static

    But changing the values here have no effect, the icon or text in the
    buttons (normal ttk::button, checkbutton, ratiobutton with -style
    Toolbutton) have no margin an go up to the button edge.

    Here is how to test:

    package require ttk::theme::awdark
    ttk::style theme use awdark
    pack [::ttk::button .b -text Test -style Toolbutton]

    Can anywone help?

    Many thanks
    Alex
    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From et99@et99@rocketship1.me to comp.lang.tcl on Fri Mar 20 21:46:48 2026
    From Newsgroup: comp.lang.tcl

    On 3/20/2026 5:30 AM, meshparts wrote:
    I'm having issues with awthemes and awdark.
    The buttons padding is in most cases 0 and I want to reset it to original values.
    I could identify the settings (I think) in awthemes.tcl, where the *.padding properties are set, for example:

    set vars(names.colors.derived) { \
    other     checkbutton.padding           {5 0 1 2}               static

    But changing the values here have no effect, the icon or text in the buttons (normal ttk::button, checkbutton, ratiobutton with -style Toolbutton) have no margin an go up to the button edge.

    Here is how to test:

    package require ttk::theme::awdark
    ttk::style theme use awdark
    pack [::ttk::button .b -text Test -style Toolbutton]

    Can anywone help?

    Many thanks
    Alex


    I think you want -padding {list} for ttk::button it's one of those inherited options not mentioned directly in the ttk::button section, but is mentioned as a styling option down below. It turns out you can set the value for either just the widget (on creation or configure) or the entire widget class using the style commands.

    The {list} can be 1, 2, or 4 values, with something like left, right, top, bottom. If you use less than 4 you'll have to try it out, because I don't know where that's documented how it fills in the 4 if some are left out. They call it padding but don't say what that is.

    -e

    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From et99@et99@rocketship1.me to comp.lang.tcl on Sat Mar 21 13:54:57 2026
    From Newsgroup: comp.lang.tcl

    On 3/20/2026 9:46 PM, et99 wrote:
    The {list} can be 1, 2, or 4 values, with something like left, right, top, bottom. If you use less than 4 you'll have to try it out, because I don't know where that's documented how it fills in the 4 if some are left out. They call it padding but don't say what that is.

    Found it, it's described in the manual under ttk::widget.

    --- Synchronet 3.21d-Linux NewsLink 1.2