SebastianPilarz / gtk-native-tweaks

Some GTK4 tweaks focusing native windows

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gtk-native-tweaks

Batch of tweaks to give more control over GTK4 applications Alt Text

Note: At the moment only macOS is supported.

Some features

  • change the titlebar color
  • change the window position
  • activate/deactivate titlebar buttons

Setup & build

Requirements:

  • C++14 and C11 compilers
  • meson
  • gtk4
  • git

Build: clone and cd into the directory

meson setup build
cd build
meson compile

Test

Make tests interactive:

cd ..
meson configure build -Dinteractive_test=true

Run

meson test --verbose

Install

meson install

Uninstall

ninja uninstall

Usage

Meson

gnt_dep = dependency('gnt-0.1')
e = executable(
...
dependencies: [gnt_dep],
...
)

Cmake

find_package(PkgConfig REQUIRED)
pkg_search_module(gnt REQUIRED IMPORTED_TARGET gnt-0.1>=0.1)

target_link_libraries(... PkgConfig::gnt)

C/C++

#include <gnt/gnt.h>
...
gtk_window_present(window) // window must be presented before, but it's fast so it's not a problem
GntMacosWindow *gnt_macos_window_new(window);
// here all the tweaks

Note: There are functions independent to the GntMacosWindow object, you can use them without creating an object.

Python

Python bindings are available and installed by default, there is an example in the examples directory.

Note: At the moment there is no stubs generated, but the api is almost the same as the C api (just look at the header file).

About

Some GTK4 tweaks focusing native windows

License:MIT License


Languages

Language:C++ 89.3%Language:Python 6.9%Language:C 1.5%Language:CMake 1.0%Language:Starlark 0.8%Language:Shell 0.2%Language:Meson 0.1%Language:SCSS 0.1%Language:HTML 0.1%Language:Batchfile 0.0%