How to make dock butons smaller?


I’ve tried Synfig Studio and I really like it.
Only one annoying thing for me is huge dock buttons (see screenshot)

On screenshots in Documentation I see small ones:

Is it possible to hide them or make them smaller?

Hi lowenware and welcome here

definitively agree, there is a lot of wasted space in the UI (hummm blender!) … In your case i’ts crazy ! … what is your configuration ? (os version …)

One simple things you can try is to change the gtk theme for synfig : something like that could maybe help you. Please, when you solve it, can you share ?

Homebrew synfig usually (on debian&co for ex) use the system theme not the bundled one (“Clearlooks” i guess)

ArchLinux 4.5.1-1-ARCH
gtk3 3.20.3-1 
synfigstudio 1.0.2
GtkTheme Adwaita, Clearlooks, Industrial, High Contrast the same problem

trying to build from sources…

Tried to build via abs. No success. Still same huge buttons.
I also tried to change font and icons.

In stdout I have this repeatedly if I try to dock windows using those buttons:

(synfigstudio:25654): Gtk-WARNING **: drawing failure for widget 'gtkmm__GtkWindow': cairo_restore() without matching cairo_save()

(synfigstudio:25654): Gtk-WARNING **: Allocating size to gtkmm__GtkVPaned 0x1deb640 without calling gtk_widget_get_preferred_width/height(). How does the code know the size to allocate?

Not tested
Try to change the height of the buttons adding gtk_widget_get_preferred_heigth
in synfig\synfig-studio\src\gui\docks\dockdroparea.cpp (in constructor DockDropArea::DockDropArea)
for each of the 4 buttons after they have been instanciated

Month ago i already take a look to this problem … from what i remember DockDropArea’ size is related to panel’ size …

I’ve tried with this constructor with no success

DockDropArea::DockDropArea(Gtk::Widget *target):
	Gtk::Table(3, 3, true),
	std::vector<Gtk::TargetEntry> listTargets;
	listTargets.push_back( Gtk::TargetEntry("SYNFIG_DOCK") );

	Gtk::Button *button_left   = manage(new Gtk::Button());
	Gtk::Button *button_right  = manage(new Gtk::Button());
	Gtk::Button *button_top    = manage(new Gtk::Button());
	Gtk::Button *button_bottom = manage(new Gtk::Button());



    int minimum_height = 8;
    int natural_height = 8;

    button_left->get_preferred_height(minimum_height, natural_height);
    button_right->get_preferred_height(minimum_height, natural_height);
    button_top->get_preferred_height(minimum_height, natural_height);
    button_bottom->get_preferred_height(minimum_height, natural_height);

	attach(*button_left,   0, 1, 1, 2, Gtk::FILL, Gtk::FILL);
	attach(*button_right,  2, 3, 1, 2, Gtk::FILL, Gtk::FILL);
	attach(*button_top,    1, 2, 0, 1, Gtk::FILL, Gtk::FILL);
	attach(*button_bottom, 1, 2, 2, 3, Gtk::FILL, Gtk::FILL);

i can’t try right now… but i will look this direction : synfigstudio::Dockable::create_tab_label + gtknotebook::set_tab_label

Or maybe not ! … has the tab icon is definitively smaller than the DockDropArea in your case .

Just noticed it is using only Gtk::FILL during attach.
Many times in the source code we encounter a combination of Gtk::EXPAND|Gtk::FILL and Gtk::SHRINK|Gtk::FILL. … le–attach

Maybe you could have a try like this (with the 4 buttons)

attach(*button_bottom, 1, 2, 2, 3, Gtk::FILL, Gtk::FILL);
attach(*button_bottom, 1, 2, 2, 3, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK|Gtk::FILL);

Now that I am “playing” with a Fedora 24 in VirtualBox, I found out there is an issue with GTK 3.20 :confused:
It has been widely discussed during the last months on the internet as most of the themes (even Adwaita, default one) are broken.
It seems it has nothing to do with Synfig but GTK version (I was under F23/GTK 3.18).

Use another GTK Theme
As a workaround, you can try to install another theme and select it instead of Adwaita.
On F24 (gnome), I installed breeze-gtk theme (sudo dnf install breeze-gtk*)

From the terminal invoke gnome-tweak-tool, then select GTK+ appearance as Breeze (Light or Dark, as you wish :wink: )
You will surely have to modify the Interface Font Name/Size (see the link on the top of this post for a settings example)

You need to edit /home/username/.config/lxsession/LXDE/desktop.conf

With an environement variable/desktop file
A last possibility is to do a .sh file (with execution premission) containing a reference to the expected GTK_THEME.
It can be done this way per application.
(And you can add an entry on your desktop pointing to it as well, sere here)

Hoping this will help :slight_smile:

Well done!

I just fixed this in master. The size is hardcoded for now, so might need some tweaking later, but it should be good enough for common resolutions & themes.