Compare commits
4 Commits
fix_toolti
...
async-dial
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
01bcd96d16 | ||
|
|
951773452a | ||
|
|
d0af6f812d | ||
|
|
b665a95558 |
132
.gitlab-ci.yml
132
.gitlab-ci.yml
@@ -22,11 +22,11 @@ stages:
|
|||||||
|
|
||||||
# Common variables
|
# Common variables
|
||||||
variables:
|
variables:
|
||||||
COMMON_MESON_FLAGS: "-Dwerror=true -Dcairo:werror=false -Dgi-docgen:werror=false -Dgraphene:werror=false -Dlibepoxy:werror=false -Dlibsass:werror=false -Dpango:werror=false -Dsassc:werror=false -Dgdk-pixbuf:werror=false -Dglib:werror=false -Dlibcloudproviders:werror=false -Dlibpng:werror=false -Dlibtiff:werror=false -Dsysprof:werror=false -Dwayland-protocols:werror=false -Dharfbuzz:werror=false -Dfreetype2:werror=false -Dfontconfig:werror=false -Dfribidi:werror=false -Dlibffi:werror=false -Dlibjpeg-turbo:werror=false -Dmutest:werror=false -Dpixman:werror=false -Dproxy-libintl:werror=false"
|
COMMON_MESON_FLAGS: "-Dwerror=true -Dglib:werror=false -Dpango:werror=false -Dgtk-doc:werror=false -Dwayland-protocols:werror=false -Dsysprof:werror=false -Dwayland:werror=false"
|
||||||
BACKEND_FLAGS: "-Dx11-backend=true -Dwayland-backend=true -Dbroadway-backend=true"
|
BACKEND_FLAGS: "-Dx11-backend=true -Dwayland-backend=true -Dbroadway-backend=true"
|
||||||
FEATURE_FLAGS: "-Dvulkan=enabled -Dcloudproviders=enabled -Ddemos=false -Dbuild-examples=false -Dbuild-tests=false -Dbuild-testsuite=true"
|
FEATURE_FLAGS: "-Dvulkan=enabled -Dcloudproviders=enabled"
|
||||||
MESON_TEST_TIMEOUT_MULTIPLIER: 3
|
MESON_TEST_TIMEOUT_MULTIPLIER: 3
|
||||||
FEDORA_IMAGE: "registry.gitlab.gnome.org/gnome/gtk/fedora:v40"
|
FEDORA_IMAGE: "registry.gitlab.gnome.org/gnome/gtk/fedora:v38"
|
||||||
FLATPAK_IMAGE: "quay.io/gnome_infrastructure/gnome-runtime-images:gnome-master"
|
FLATPAK_IMAGE: "quay.io/gnome_infrastructure/gnome-runtime-images:gnome-master"
|
||||||
|
|
||||||
.only-default:
|
.only-default:
|
||||||
@@ -51,11 +51,8 @@ style-check-diff:
|
|||||||
reports:
|
reports:
|
||||||
junit:
|
junit:
|
||||||
- "${CI_PROJECT_DIR}/_build/report-x11.xml"
|
- "${CI_PROJECT_DIR}/_build/report-x11.xml"
|
||||||
- "${CI_PROJECT_DIR}/_build/report-x11_unstable.xml"
|
|
||||||
- "${CI_PROJECT_DIR}/_build/report-wayland.xml"
|
- "${CI_PROJECT_DIR}/_build/report-wayland.xml"
|
||||||
- "${CI_PROJECT_DIR}/_build/report-wayland_unstable.xml"
|
|
||||||
- "${CI_PROJECT_DIR}/_build/report-broadway.xml"
|
- "${CI_PROJECT_DIR}/_build/report-broadway.xml"
|
||||||
- "${CI_PROJECT_DIR}/_build/report-broadway_unstable.xml"
|
|
||||||
name: "gtk-${CI_COMMIT_REF_NAME}"
|
name: "gtk-${CI_COMMIT_REF_NAME}"
|
||||||
paths:
|
paths:
|
||||||
- "${CI_PROJECT_DIR}/_build/meson-logs"
|
- "${CI_PROJECT_DIR}/_build/meson-logs"
|
||||||
@@ -71,6 +68,11 @@ style-check-diff:
|
|||||||
key: "$CI_JOB_NAME"
|
key: "$CI_JOB_NAME"
|
||||||
paths:
|
paths:
|
||||||
- _ccache/
|
- _ccache/
|
||||||
|
- subprojects/gdk-pixbuf/
|
||||||
|
- subprojects/glib/
|
||||||
|
- subprojects/graphene/
|
||||||
|
- subprojects/libepoxy/
|
||||||
|
- subprojects/pango/
|
||||||
|
|
||||||
fedora-x86_64:
|
fedora-x86_64:
|
||||||
extends: .build-fedora-default
|
extends: .build-fedora-default
|
||||||
@@ -80,17 +82,10 @@ fedora-x86_64:
|
|||||||
EXTRA_MESON_FLAGS: "--buildtype=debug --default-library=both"
|
EXTRA_MESON_FLAGS: "--buildtype=debug --default-library=both"
|
||||||
script:
|
script:
|
||||||
- .gitlab-ci/show-info-linux.sh
|
- .gitlab-ci/show-info-linux.sh
|
||||||
- export PATH="$HOME/.local/bin:$PATH"
|
- meson subprojects update
|
||||||
- pip3 install --user meson~=0.64
|
|
||||||
- meson subprojects download
|
|
||||||
- meson subprojects update --reset
|
|
||||||
- mkdir _install
|
- mkdir _install
|
||||||
- meson setup
|
- meson --prefix=${CI_PROJECT_DIR}/_install
|
||||||
--prefix=${CI_PROJECT_DIR}/_install
|
${COMMON_MESON_FLAGS} ${EXTRA_MESON_FLAGS} ${BACKEND_FLAGS} ${FEATURE_FLAGS}
|
||||||
${COMMON_MESON_FLAGS}
|
|
||||||
${EXTRA_MESON_FLAGS}
|
|
||||||
${BACKEND_FLAGS}
|
|
||||||
${FEATURE_FLAGS}
|
|
||||||
_build
|
_build
|
||||||
- meson compile -C _build
|
- meson compile -C _build
|
||||||
- meson install -C _build
|
- meson install -C _build
|
||||||
@@ -109,17 +104,10 @@ release-build:
|
|||||||
EXTRA_MESON_FLAGS: "--buildtype=release"
|
EXTRA_MESON_FLAGS: "--buildtype=release"
|
||||||
script:
|
script:
|
||||||
- .gitlab-ci/show-info-linux.sh
|
- .gitlab-ci/show-info-linux.sh
|
||||||
- export PATH="$HOME/.local/bin:$PATH"
|
- meson subprojects update
|
||||||
- pip3 install --user meson~=0.64
|
- meson ${COMMON_MESON_FLAGS} ${EXTRA_MESON_FLAGS} ${BACKEND_FLAGS} ${FEATURE_FLAGS}
|
||||||
- meson subprojects download
|
|
||||||
- meson subprojects update --reset
|
|
||||||
- meson setup
|
|
||||||
${COMMON_MESON_FLAGS}
|
|
||||||
${EXTRA_MESON_FLAGS}
|
|
||||||
${BACKEND_FLAGS}
|
|
||||||
${FEATURE_FLAGS}
|
|
||||||
_build
|
_build
|
||||||
- meson compile -C _build
|
- ninja -C _build
|
||||||
- .gitlab-ci/run-tests.sh _build x11
|
- .gitlab-ci/run-tests.sh _build x11
|
||||||
|
|
||||||
fedora-mingw64:
|
fedora-mingw64:
|
||||||
@@ -140,24 +128,34 @@ fedora-mingw64:
|
|||||||
# mingw64-graphene (rawhide)
|
# mingw64-graphene (rawhide)
|
||||||
script:
|
script:
|
||||||
- .gitlab-ci/show-info-linux.sh
|
- .gitlab-ci/show-info-linux.sh
|
||||||
- export PATH="$HOME/.local/bin:$PATH"
|
- meson subprojects update
|
||||||
- pip3 install --user meson~=0.64
|
- mkdir _build && cd _build
|
||||||
- meson subprojects download
|
- mingw64-meson -Dintrospection=disabled -Dgraphene:introspection=disabled
|
||||||
- meson subprojects update --reset
|
- ninja
|
||||||
# Test that mingw64-meson still fails. If it has stopped failing, the CI
|
|
||||||
# will fail and now you should remove the hack that follows this.
|
installed-tests:
|
||||||
- FAILED=false
|
extends: .build-fedora-default
|
||||||
- mingw64-meson --version || FAILED=true
|
stage: build
|
||||||
- test $FAILED = false && echo "mingw64-meson works now, remove the hack" && exit 1
|
needs: []
|
||||||
# HACK: Running mingw64-meson directly fails on the CI with:
|
variables:
|
||||||
# /usr/bin/mingw64-meson: line 92: fg: no job control
|
EXTRA_MESON_FLAGS: "--prefix=/usr --libdir=/usr/lib64 -Dinstall-tests=true"
|
||||||
# Because rpm is not evaluating %__meson and it gets interpreted as a job
|
G_TEST_ACCESSIBLE: 1
|
||||||
# specifier. So we fix that and run it ourselves.
|
script:
|
||||||
- rpm --eval "%{mingw64_meson}" > mingw64-meson.sh
|
- .gitlab-ci/show-info-linux.sh
|
||||||
- sed -i -e 's/%__meson/meson/' mingw64-meson.sh
|
- meson subprojects update
|
||||||
- chmod +x mingw64-meson.sh
|
- meson ${COMMON_MESON_FLAGS} ${EXTRA_MESON_FLAGS} ${BACKEND_FLAGS} ${FEATURE_FLAGS}
|
||||||
- ./mingw64-meson.sh -Dintrospection=disabled -Dgraphene:introspection=disabled _build
|
_build
|
||||||
- ninja -C _build
|
- ninja -C _build
|
||||||
|
- sudo ninja -C _build install
|
||||||
|
- dbus-run-session xvfb-run -a -s "-screen 0 1024x768x24"
|
||||||
|
gnome-desktop-testing-runner
|
||||||
|
--report-directory=_build/installed-tests-report/failed/
|
||||||
|
--parallel=0
|
||||||
|
gtk-4.0
|
||||||
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- "_build/installed-tests-report/"
|
||||||
|
|
||||||
|
|
||||||
.mingw-defaults:
|
.mingw-defaults:
|
||||||
extends: .only-default
|
extends: .only-default
|
||||||
@@ -190,37 +188,30 @@ msys2-mingw64:
|
|||||||
- "${CI_PROJECT_DIR}/_build/gtkdll.tar.gz"
|
- "${CI_PROJECT_DIR}/_build/gtkdll.tar.gz"
|
||||||
|
|
||||||
macos:
|
macos:
|
||||||
# Sadly, this fails regularly, and its failure is never enlightening
|
|
||||||
allow_failure: true
|
|
||||||
extends: .only-default
|
extends: .only-default
|
||||||
only:
|
only:
|
||||||
- branches@GNOME/gtk
|
- branches@GNOME/gtk
|
||||||
stage: build
|
stage: build
|
||||||
|
allow_failure: true
|
||||||
tags:
|
tags:
|
||||||
- macos
|
- macos
|
||||||
needs: []
|
needs: []
|
||||||
before_script:
|
before_script:
|
||||||
- bash .gitlab-ci/show-info-osx.sh
|
- bash .gitlab-ci/show-info-osx.sh
|
||||||
- pip3 install --user meson~=0.64
|
- pip3 install --user meson==0.60.3
|
||||||
- pip3 install --user ninja
|
- pip3 install --user ninja
|
||||||
- export PATH=/Users/gitlabrunner/Library/Python/3.7/bin:$PATH
|
- export PATH=/Users/gitlabrunner/Library/Python/3.7/bin:$PATH
|
||||||
- export MESON_FORCE_BACKTRACE=1
|
- export MESON_FORCE_BACKTRACE=1
|
||||||
script:
|
script:
|
||||||
- meson setup ${COMMON_MESON_FLAGS}
|
- meson -Dx11-backend=false
|
||||||
-Dx11-backend=false
|
|
||||||
-Dbroadway-backend=true
|
-Dbroadway-backend=true
|
||||||
-Dmacos-backend=true
|
-Dmacos-backend=true
|
||||||
-Dmedia-gstreamer=disabled
|
-Dmedia-gstreamer=disabled
|
||||||
-Dintrospection=disabled
|
-Dintrospection=disabled
|
||||||
-Dcpp_std=c++11
|
-Dcpp_std=c++11
|
||||||
-Dpixman:tests=disabled
|
-Dpixman:tests=disabled
|
||||||
-Dlibjpeg-turbo:simd=disabled
|
|
||||||
-Ddemos=false
|
|
||||||
-Dbuild-tests=false
|
|
||||||
-Dbuild-examples=false
|
|
||||||
-Dbuild-testsuite=false
|
|
||||||
_build
|
_build
|
||||||
- meson compile -C _build
|
- ninja -C _build
|
||||||
artifacts:
|
artifacts:
|
||||||
when: always
|
when: always
|
||||||
paths:
|
paths:
|
||||||
@@ -345,20 +336,15 @@ static-scan:
|
|||||||
variables:
|
variables:
|
||||||
EXTRA_MESON_FLAGS: "--buildtype=debug"
|
EXTRA_MESON_FLAGS: "--buildtype=debug"
|
||||||
script:
|
script:
|
||||||
- export PATH="$HOME/.local/bin:$PATH"
|
- meson ${COMMON_MESON_FLAGS} ${EXTRA_MESON_FLAGS} _scan_build
|
||||||
- pip3 install --user meson~=0.64
|
|
||||||
- meson setup
|
|
||||||
${COMMON_MESON_FLAGS}
|
|
||||||
${EXTRA_MESON_FLAGS}
|
|
||||||
_scan_build
|
|
||||||
- ninja -C _scan_build scan-build
|
- ninja -C _scan_build scan-build
|
||||||
artifacts:
|
artifacts:
|
||||||
paths:
|
paths:
|
||||||
- _scan_build/meson-logs
|
- _scan_build/meson-logs
|
||||||
allow_failure: true
|
allow_failure: true
|
||||||
|
|
||||||
# Run tests with the address sanitizer. We need to turn off introspection
|
# Run tests with the address sanitizer. We need to turn off introspection,
|
||||||
# and f16c, since they are incompatible with asan
|
# since it is incompatible with asan
|
||||||
asan-build:
|
asan-build:
|
||||||
image: $FEDORA_IMAGE
|
image: $FEDORA_IMAGE
|
||||||
tags: [ asan ]
|
tags: [ asan ]
|
||||||
@@ -366,9 +352,7 @@ asan-build:
|
|||||||
needs: []
|
needs: []
|
||||||
variables:
|
variables:
|
||||||
script:
|
script:
|
||||||
- export PATH="$HOME/.local/bin:$PATH"
|
- CC=clang meson --buildtype=debugoptimized -Db_sanitize=address -Db_lundef=false -Dintrospection=disabled _build
|
||||||
- pip3 install --user meson~=0.64
|
|
||||||
- CC=clang meson setup --buildtype=debugoptimized -Db_sanitize=address -Db_lundef=false -Dintrospection=disabled -Df16c=disabled _build
|
|
||||||
- ninja -C _build
|
- ninja -C _build
|
||||||
- .gitlab-ci/run-tests.sh _build wayland
|
- .gitlab-ci/run-tests.sh _build wayland
|
||||||
artifacts:
|
artifacts:
|
||||||
@@ -380,22 +364,10 @@ reference:
|
|||||||
image: $FEDORA_IMAGE
|
image: $FEDORA_IMAGE
|
||||||
stage: docs
|
stage: docs
|
||||||
needs: []
|
needs: []
|
||||||
|
variables:
|
||||||
|
EXTRA_MESON_FLAGS: "--buildtype=release --force-fallback-for=gdk-pixbuf,pango"
|
||||||
script:
|
script:
|
||||||
- export PATH="$HOME/.local/bin:$PATH"
|
- meson ${COMMON_MESON_FLAGS} ${EXTRA_MESON_FLAGS} -Dgtk_doc=true -Dgdk-pixbuf:gtk_doc=true -Dpango:gtk_doc=true _build
|
||||||
- pip3 install --user meson~=0.64
|
|
||||||
- meson setup
|
|
||||||
${COMMON_MESON_FLAGS}
|
|
||||||
--buildtype=release
|
|
||||||
--force-fallback-for=gdk-pixbuf,pango
|
|
||||||
-Dintrospection=enabled
|
|
||||||
-Dgtk_doc=true
|
|
||||||
-Dgdk-pixbuf:gtk_doc=true
|
|
||||||
-Dpango:gtk_doc=true
|
|
||||||
-Ddemos=false
|
|
||||||
-Dbuild-examples=false
|
|
||||||
-Dbuild-tests=false
|
|
||||||
-Dbuild-testsuite=false
|
|
||||||
_build
|
|
||||||
- meson compile -C _build
|
- meson compile -C _build
|
||||||
- mkdir -p _reference/
|
- mkdir -p _reference/
|
||||||
- mv _build/docs/reference/gdk/gdk4/ _reference/gdk4/
|
- mv _build/docs/reference/gdk/gdk4/ _reference/gdk4/
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
FROM fedora:37
|
FROM fedora:36
|
||||||
|
|
||||||
RUN dnf -y install \
|
RUN dnf -y install \
|
||||||
adwaita-icon-theme \
|
adwaita-icon-theme \
|
||||||
@@ -18,9 +18,7 @@ RUN dnf -y install \
|
|||||||
dejavu-sans-mono-fonts \
|
dejavu-sans-mono-fonts \
|
||||||
desktop-file-utils \
|
desktop-file-utils \
|
||||||
diffutils \
|
diffutils \
|
||||||
docbook-style-xsl \
|
|
||||||
elfutils-libelf-devel \
|
elfutils-libelf-devel \
|
||||||
expat-devel \
|
|
||||||
fribidi-devel \
|
fribidi-devel \
|
||||||
gcc \
|
gcc \
|
||||||
gcc-c++ \
|
gcc-c++ \
|
||||||
@@ -33,7 +31,6 @@ RUN dnf -y install \
|
|||||||
glibc-devel \
|
glibc-devel \
|
||||||
glibc-headers \
|
glibc-headers \
|
||||||
gnome-desktop-testing \
|
gnome-desktop-testing \
|
||||||
gnupg2 \
|
|
||||||
gobject-introspection-devel \
|
gobject-introspection-devel \
|
||||||
graphene-devel \
|
graphene-devel \
|
||||||
graphviz \
|
graphviz \
|
||||||
@@ -73,6 +70,7 @@ RUN dnf -y install \
|
|||||||
mesa-dri-drivers \
|
mesa-dri-drivers \
|
||||||
mesa-libEGL-devel \
|
mesa-libEGL-devel \
|
||||||
mesa-libGLES-devel \
|
mesa-libGLES-devel \
|
||||||
|
meson \
|
||||||
ninja-build \
|
ninja-build \
|
||||||
pango-devel \
|
pango-devel \
|
||||||
pcre-devel \
|
pcre-devel \
|
||||||
@@ -84,6 +82,7 @@ RUN dnf -y install \
|
|||||||
python3-markdown \
|
python3-markdown \
|
||||||
python3-pip \
|
python3-pip \
|
||||||
python3-pygments \
|
python3-pygments \
|
||||||
|
python3-toml \
|
||||||
python3-typogrify \
|
python3-typogrify \
|
||||||
python3-wheel \
|
python3-wheel \
|
||||||
redhat-rpm-config \
|
redhat-rpm-config \
|
||||||
@@ -95,6 +94,8 @@ RUN dnf -y install \
|
|||||||
weston-libs \
|
weston-libs \
|
||||||
which \
|
which \
|
||||||
xorg-x11-server-Xvfb \
|
xorg-x11-server-Xvfb \
|
||||||
|
&& dnf install -y 'dnf-command(builddep)' \
|
||||||
|
&& dnf builddep -y wayland \
|
||||||
&& dnf clean all
|
&& dnf clean all
|
||||||
|
|
||||||
# Enable sudo for wheel users
|
# Enable sudo for wheel users
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ builddir=$1
|
|||||||
backend=$2
|
backend=$2
|
||||||
|
|
||||||
# Ignore memory leaks lower in dependencies
|
# Ignore memory leaks lower in dependencies
|
||||||
export LSAN_OPTIONS=suppressions=$srcdir/lsan.supp:print_suppressions=0:verbosity=1:log_threads=1
|
export LSAN_OPTIONS=suppressions=$srcdir/lsan.supp:print_suppressions=0
|
||||||
export G_SLICE=always-malloc
|
export G_SLICE=always-malloc
|
||||||
|
|
||||||
case "${backend}" in
|
case "${backend}" in
|
||||||
@@ -19,21 +19,11 @@ case "${backend}" in
|
|||||||
--print-errorlogs \
|
--print-errorlogs \
|
||||||
--setup=${backend} \
|
--setup=${backend} \
|
||||||
--suite=gtk \
|
--suite=gtk \
|
||||||
--no-suite=failing \
|
|
||||||
--no-suite=flaky \
|
|
||||||
--no-suite=gsk-compare-broadway
|
--no-suite=gsk-compare-broadway
|
||||||
|
|
||||||
# Store the exit code for the CI run, but always
|
# Store the exit code for the CI run, but always
|
||||||
# generate the reports
|
# generate the reports
|
||||||
exit_code=$?
|
exit_code=$?
|
||||||
|
|
||||||
xvfb-run -a -s "-screen 0 1024x768x24 -noreset" \
|
|
||||||
meson test -C ${builddir} \
|
|
||||||
--timeout-multiplier "${MESON_TEST_TIMEOUT_MULTIPLIER}" \
|
|
||||||
--print-errorlogs \
|
|
||||||
--setup=${backend}_unstable \
|
|
||||||
--suite=flaky \
|
|
||||||
--suite=failing || true
|
|
||||||
;;
|
;;
|
||||||
|
|
||||||
wayland)
|
wayland)
|
||||||
@@ -48,18 +38,9 @@ case "${backend}" in
|
|||||||
--print-errorlogs \
|
--print-errorlogs \
|
||||||
--setup=${backend} \
|
--setup=${backend} \
|
||||||
--suite=gtk \
|
--suite=gtk \
|
||||||
--no-suite=failing \
|
|
||||||
--no-suite=flaky \
|
|
||||||
--no-suite=gsk-compare-broadway
|
--no-suite=gsk-compare-broadway
|
||||||
|
|
||||||
exit_code=$?
|
exit_code=$?
|
||||||
|
|
||||||
meson test -C ${builddir} \
|
|
||||||
--timeout-multiplier "${MESON_TEST_TIMEOUT_MULTIPLIER}" \
|
|
||||||
--print-errorlogs \
|
|
||||||
--setup=${backend}_unstable \
|
|
||||||
--suite=flaky \
|
|
||||||
--suite=failing || true
|
|
||||||
|
|
||||||
kill ${compositor}
|
kill ${compositor}
|
||||||
;;
|
;;
|
||||||
|
|
||||||
@@ -75,18 +56,9 @@ case "${backend}" in
|
|||||||
--print-errorlogs \
|
--print-errorlogs \
|
||||||
--setup=${backend} \
|
--setup=${backend} \
|
||||||
--suite=gtk \
|
--suite=gtk \
|
||||||
--no-suite=failing \
|
|
||||||
--no-suite=flaky \
|
|
||||||
--no-suite=gsk-compare-broadway
|
--no-suite=gsk-compare-broadway
|
||||||
|
|
||||||
exit_code=$?
|
exit_code=$?
|
||||||
|
|
||||||
meson test -C ${builddir} \
|
|
||||||
--timeout-multiplier "${MESON_TEST_TIMEOUT_MULTIPLIER}" \
|
|
||||||
--print-errorlogs \
|
|
||||||
--setup=${backend}_unstable \
|
|
||||||
--suite=flaky \
|
|
||||||
--suite=failing || true
|
|
||||||
|
|
||||||
kill ${compositor}
|
kill ${compositor}
|
||||||
;;
|
;;
|
||||||
|
|
||||||
@@ -102,20 +74,10 @@ case "${backend}" in
|
|||||||
--print-errorlogs \
|
--print-errorlogs \
|
||||||
--setup=${backend} \
|
--setup=${backend} \
|
||||||
--suite=gtk \
|
--suite=gtk \
|
||||||
--no-suite=failing \
|
|
||||||
--no-suite=flaky \
|
|
||||||
--no-suite=gsk-compare-opengl
|
--no-suite=gsk-compare-opengl
|
||||||
|
|
||||||
# don't let Broadway failures fail the run, for now
|
# don't let Broadway failures fail the run, for now
|
||||||
exit_code=0
|
exit_code=0
|
||||||
|
|
||||||
meson test -C ${builddir} \
|
|
||||||
--timeout-multiplier "${MESON_TEST_TIMEOUT_MULTIPLIER}" \
|
|
||||||
--print-errorlogs \
|
|
||||||
--setup=${backend}_unstable \
|
|
||||||
--suite=flaky \
|
|
||||||
--suite=failing || true
|
|
||||||
|
|
||||||
kill ${server}
|
kill ${server}
|
||||||
;;
|
;;
|
||||||
|
|
||||||
@@ -128,20 +90,18 @@ esac
|
|||||||
|
|
||||||
cd ${builddir}
|
cd ${builddir}
|
||||||
|
|
||||||
for suffix in "" "_unstable"; do
|
$srcdir/.gitlab-ci/meson-junit-report.py \
|
||||||
$srcdir/.gitlab-ci/meson-junit-report.py \
|
--project-name=gtk \
|
||||||
--project-name=gtk \
|
--backend=${backend} \
|
||||||
--backend="${backend}${suffix}" \
|
--job-id="${CI_JOB_NAME}" \
|
||||||
--job-id="${CI_JOB_NAME}" \
|
--output=report-${backend}.xml \
|
||||||
--output="report-${backend}${suffix}.xml" \
|
meson-logs/testlog-${backend}.json
|
||||||
"meson-logs/testlog-${backend}${suffix}.json"
|
$srcdir/.gitlab-ci/meson-html-report.py \
|
||||||
$srcdir/.gitlab-ci/meson-html-report.py \
|
--project-name=gtk \
|
||||||
--project-name=gtk \
|
--backend=${backend} \
|
||||||
--backend="${backend}${suffix}" \
|
--job-id="${CI_JOB_NAME}" \
|
||||||
--job-id="${CI_JOB_NAME}" \
|
--reftest-output-dir="testsuite/reftests/output/${backend}" \
|
||||||
--reftest-output-dir="testsuite/reftests/output/${backend}${suffix}" \
|
--output=report-${backend}.html \
|
||||||
--output="report-${backend}${suffix}.html" \
|
meson-logs/testlog-${backend}.json
|
||||||
"meson-logs/testlog-${backend}${suffix}.json"
|
|
||||||
done
|
|
||||||
|
|
||||||
exit $exit_code
|
exit $exit_code
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ call "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliar
|
|||||||
@echo on
|
@echo on
|
||||||
|
|
||||||
:: FIXME: make warnings fatal
|
:: FIXME: make warnings fatal
|
||||||
pip3 install --upgrade --user meson~=0.64 || goto :error
|
pip3 install --upgrade --user meson==0.60.3 || goto :error
|
||||||
meson -Ddebug=false -Dmedia-gstreamer=disabled _build || goto :error
|
meson -Ddebug=false -Dmedia-gstreamer=disabled _build || goto :error
|
||||||
ninja -C _build || goto :error
|
ninja -C _build || goto :error
|
||||||
|
|
||||||
|
|||||||
99
NEWS
99
NEWS
@@ -1,82 +1,9 @@
|
|||||||
Overview of Changes in 4.9.3, xx-xx-xxxx
|
Overview of Changes in 4.9.1, dd-mm-yyyy
|
||||||
========================================
|
========================================
|
||||||
|
|
||||||
Overview of Changes in 4.9.2, 26-12-2022
|
Note that deprecations are an early outlook
|
||||||
========================================
|
at changes that will appear in an eventual
|
||||||
|
GTK 5 release, which is still far away.
|
||||||
* GtkFileChooserWidget:
|
|
||||||
- Add a grid view
|
|
||||||
|
|
||||||
* GtkText, GtkTextView:
|
|
||||||
- Fix activation of the on-screen keyboard
|
|
||||||
- Prevent unexpected text direction changes
|
|
||||||
|
|
||||||
* GtkCenterBox:
|
|
||||||
- Add properties for children
|
|
||||||
|
|
||||||
* GtkTreeExpander:
|
|
||||||
- Add a hide-expander property
|
|
||||||
|
|
||||||
* GtkStringList:
|
|
||||||
- Add a construct-only strings property
|
|
||||||
|
|
||||||
* GtkBuilder:
|
|
||||||
- Support parsing Pango attributes in string form
|
|
||||||
|
|
||||||
* GtkGestureStylus:
|
|
||||||
- Add a stylus-only property
|
|
||||||
|
|
||||||
* GtkFileLauncher:
|
|
||||||
- New async-style api to replace gtk_show_uri
|
|
||||||
|
|
||||||
* GtkColorDialog, GtkFontDialog, GtkFileDialog,
|
|
||||||
GtkAlertDialog:
|
|
||||||
- APIs have seen some tweaks
|
|
||||||
- Prefer portals when available
|
|
||||||
- Fixes for cancellation
|
|
||||||
|
|
||||||
* Add GDK_DEBUG=no-portals
|
|
||||||
|
|
||||||
* Improve file DND with remote files
|
|
||||||
|
|
||||||
* GtkInfoBar has been deprecated
|
|
||||||
|
|
||||||
* gtk_widget_show/hide have been deprecated
|
|
||||||
|
|
||||||
* gtk_show_uri has been deprecated
|
|
||||||
|
|
||||||
* Wayland:
|
|
||||||
- Fix button mask handling
|
|
||||||
- Fix problems with cursor size on hi-dpi screens
|
|
||||||
- Support newer versions of some protocols
|
|
||||||
- Fix handling of surrounding text in input methods
|
|
||||||
|
|
||||||
* X11:
|
|
||||||
- Fix some ordering problems with surface destruction
|
|
||||||
|
|
||||||
* Windows:
|
|
||||||
- Improved system settings integration
|
|
||||||
- Fix window resizing work with native decorations
|
|
||||||
- Include a full hicolor index.theme file as a resource
|
|
||||||
|
|
||||||
* Translation updates
|
|
||||||
Croatian
|
|
||||||
Dutch
|
|
||||||
Hungarian
|
|
||||||
Interlingua
|
|
||||||
Persian
|
|
||||||
Turkish
|
|
||||||
Ukrainian
|
|
||||||
|
|
||||||
|
|
||||||
Overview of Changes in 4.9.1, 31-10-2022
|
|
||||||
========================================
|
|
||||||
|
|
||||||
Note that deprecations are an early outlook at changes
|
|
||||||
that will appear in an eventual GTK 5 release, which is
|
|
||||||
still far away. We are introducing deprecations in 4.10
|
|
||||||
as a way to give users time to adapt, and to provide
|
|
||||||
feedback on our plans.
|
|
||||||
|
|
||||||
* GtkTreeView, GtkIconView, GtkComboBox and
|
* GtkTreeView, GtkIconView, GtkComboBox and
|
||||||
auxiliary classes have been deprecated
|
auxiliary classes have been deprecated
|
||||||
@@ -88,21 +15,7 @@ feedback on our plans.
|
|||||||
* gtk_render_ and gtk_snapshot_render_ APIs
|
* gtk_render_ and gtk_snapshot_render_ APIs
|
||||||
have been deprecated
|
have been deprecated
|
||||||
|
|
||||||
* GtkAppChooser widgets have been deprecated
|
* GtkAppChooser widgets hae been deprecated
|
||||||
|
|
||||||
* GtkMessageDialog has been deprecated and
|
|
||||||
replaced by a new async dialog API
|
|
||||||
|
|
||||||
* GtkDialog has been deprecated
|
|
||||||
|
|
||||||
* GtkColorChooser, GtkFontChooser, GtkFileChooser
|
|
||||||
interfaces and their implementations have been
|
|
||||||
deprecated. A new family of async dialog APIs
|
|
||||||
has been introduced to replace them
|
|
||||||
|
|
||||||
* GtkColorDialog, GtkFontDialog, GtkFileDialog
|
|
||||||
and GtkAlertDialog are new dialog classes with
|
|
||||||
a consistent and well-bindable API
|
|
||||||
|
|
||||||
* GtkMountOperation:
|
* GtkMountOperation:
|
||||||
- Fix the dialog to look reasonable
|
- Fix the dialog to look reasonable
|
||||||
@@ -119,8 +32,6 @@ feedback on our plans.
|
|||||||
- Make make debug options available in
|
- Make make debug options available in
|
||||||
non-debug builds
|
non-debug builds
|
||||||
|
|
||||||
* Increase the memory limit for the jpeg loader to 1G
|
|
||||||
|
|
||||||
* Translation updates:
|
* Translation updates:
|
||||||
Abkhazian
|
Abkhazian
|
||||||
Basque
|
Basque
|
||||||
|
|||||||
@@ -202,36 +202,43 @@ constraint_editor_window_load (ConstraintEditorWindow *self,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
open_response_cb (GObject *source,
|
open_response_cb (GtkNativeDialog *dialog,
|
||||||
GAsyncResult *result,
|
int response,
|
||||||
void *user_data)
|
ConstraintEditorWindow *self)
|
||||||
{
|
{
|
||||||
GtkFileDialog *dialog = GTK_FILE_DIALOG (source);
|
gtk_native_dialog_hide (dialog);
|
||||||
ConstraintEditorWindow *self = user_data;
|
|
||||||
GFile *file;
|
|
||||||
|
|
||||||
file = gtk_file_dialog_open_finish (dialog, result, NULL);
|
if (response == GTK_RESPONSE_ACCEPT)
|
||||||
if (file)
|
|
||||||
{
|
{
|
||||||
|
GFile *file;
|
||||||
|
|
||||||
|
file = gtk_file_chooser_get_file (GTK_FILE_CHOOSER (dialog));
|
||||||
constraint_editor_window_load (self, file);
|
constraint_editor_window_load (self, file);
|
||||||
g_object_unref (file);
|
g_object_unref (file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gtk_native_dialog_destroy (dialog);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
open_cb (GtkWidget *button,
|
open_cb (GtkWidget *button,
|
||||||
ConstraintEditorWindow *self)
|
ConstraintEditorWindow *self)
|
||||||
{
|
{
|
||||||
GtkFileDialog *dialog;
|
GtkFileChooserNative *dialog;
|
||||||
GFile *cwd;
|
|
||||||
|
|
||||||
dialog = gtk_file_dialog_new ();
|
dialog = gtk_file_chooser_native_new ("Open file",
|
||||||
gtk_file_dialog_set_title (dialog, "Open file");
|
GTK_WINDOW (self),
|
||||||
cwd = g_file_new_for_path (".");
|
GTK_FILE_CHOOSER_ACTION_OPEN,
|
||||||
gtk_file_dialog_set_initial_folder (dialog, cwd);
|
"_Load",
|
||||||
|
"_Cancel");
|
||||||
|
gtk_native_dialog_set_modal (GTK_NATIVE_DIALOG (dialog), TRUE);
|
||||||
|
|
||||||
|
GFile *cwd = g_file_new_for_path (".");
|
||||||
|
gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog), cwd, NULL);
|
||||||
g_object_unref (cwd);
|
g_object_unref (cwd);
|
||||||
gtk_file_dialog_open (dialog, GTK_WINDOW (self), NULL, open_response_cb, self);
|
|
||||||
g_object_unref (dialog);
|
g_signal_connect (dialog, "response", G_CALLBACK (open_response_cb), self);
|
||||||
|
gtk_native_dialog_show (GTK_NATIVE_DIALOG (dialog));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -287,23 +294,22 @@ serialize_model (GListModel *list)
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
save_response_cb (GObject *source,
|
save_response_cb (GtkNativeDialog *dialog,
|
||||||
GAsyncResult *result,
|
int response,
|
||||||
void *user_data)
|
ConstraintEditorWindow *self)
|
||||||
{
|
{
|
||||||
GtkFileDialog *dialog = GTK_FILE_DIALOG (source);
|
gtk_native_dialog_hide (dialog);
|
||||||
ConstraintEditorWindow *self = user_data;
|
|
||||||
GFile *file;
|
|
||||||
|
|
||||||
file = gtk_file_dialog_save_finish (dialog, result, NULL);
|
if (response == GTK_RESPONSE_ACCEPT)
|
||||||
if (file)
|
|
||||||
{
|
{
|
||||||
GListModel *model;
|
GListModel *model;
|
||||||
|
GFile *file;
|
||||||
char *text;
|
char *text;
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
|
||||||
model = constraint_view_get_model (CONSTRAINT_VIEW (self->view));
|
model = constraint_view_get_model (CONSTRAINT_VIEW (self->view));
|
||||||
text = serialize_model (model);
|
text = serialize_model (model);
|
||||||
|
file = gtk_file_chooser_get_file (GTK_FILE_CHOOSER (dialog));
|
||||||
g_file_replace_contents (file, text, strlen (text),
|
g_file_replace_contents (file, text, strlen (text),
|
||||||
NULL, FALSE,
|
NULL, FALSE,
|
||||||
G_FILE_CREATE_NONE,
|
G_FILE_CREATE_NONE,
|
||||||
@@ -312,38 +318,46 @@ save_response_cb (GObject *source,
|
|||||||
&error);
|
&error);
|
||||||
if (error != NULL)
|
if (error != NULL)
|
||||||
{
|
{
|
||||||
GtkAlertDialog *alert;
|
GtkWidget *message_dialog;
|
||||||
|
|
||||||
alert = gtk_alert_dialog_new ("Saving failed");
|
message_dialog = gtk_message_dialog_new (GTK_WINDOW (gtk_widget_get_root (GTK_WIDGET (self))),
|
||||||
gtk_alert_dialog_set_detail (alert, error->message);
|
GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||||
gtk_alert_dialog_show (alert,
|
GTK_MESSAGE_INFO,
|
||||||
GTK_WINDOW (gtk_widget_get_root (GTK_WIDGET (self))));
|
GTK_BUTTONS_OK,
|
||||||
g_object_unref (alert);
|
"Saving failed");
|
||||||
|
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (message_dialog),
|
||||||
|
"%s", error->message);
|
||||||
|
g_signal_connect (message_dialog, "response", G_CALLBACK (gtk_window_destroy), NULL);
|
||||||
|
gtk_widget_show (message_dialog);
|
||||||
g_error_free (error);
|
g_error_free (error);
|
||||||
}
|
}
|
||||||
|
|
||||||
g_free (text);
|
g_free (text);
|
||||||
g_object_unref (file);
|
g_object_unref (file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gtk_native_dialog_destroy (dialog);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
save_cb (GtkWidget *button,
|
save_cb (GtkWidget *button,
|
||||||
ConstraintEditorWindow *self)
|
ConstraintEditorWindow *self)
|
||||||
{
|
{
|
||||||
GtkFileDialog *dialog;
|
GtkFileChooserNative *dialog;
|
||||||
GFile *cwd;
|
|
||||||
|
|
||||||
dialog = gtk_file_dialog_new ();
|
dialog = gtk_file_chooser_native_new ("Save constraints",
|
||||||
gtk_file_dialog_set_title (dialog, "Save constraints");
|
GTK_WINDOW (gtk_widget_get_root (GTK_WIDGET (button))),
|
||||||
cwd = g_file_new_for_path (".");
|
GTK_FILE_CHOOSER_ACTION_SAVE,
|
||||||
gtk_file_dialog_set_initial_folder (dialog, cwd);
|
"_Save",
|
||||||
|
"_Cancel");
|
||||||
|
gtk_native_dialog_set_modal (GTK_NATIVE_DIALOG (dialog), TRUE);
|
||||||
|
|
||||||
|
GFile *cwd = g_file_new_for_path (".");
|
||||||
|
gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog), cwd, NULL);
|
||||||
g_object_unref (cwd);
|
g_object_unref (cwd);
|
||||||
gtk_file_dialog_save (dialog,
|
|
||||||
GTK_WINDOW (gtk_widget_get_root (GTK_WIDGET (button))),
|
g_signal_connect (dialog, "response", G_CALLBACK (save_response_cb), self);
|
||||||
NULL,
|
gtk_native_dialog_show (GTK_NATIVE_DIALOG (dialog));
|
||||||
save_response_cb, self);
|
|
||||||
g_object_unref (dialog);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -426,7 +440,7 @@ edit_constraint (ConstraintEditorWindow *win,
|
|||||||
|
|
||||||
g_signal_connect (editor, "done", G_CALLBACK (constraint_editor_done), win);
|
g_signal_connect (editor, "done", G_CALLBACK (constraint_editor_done), win);
|
||||||
|
|
||||||
gtk_window_present (GTK_WINDOW (window));
|
gtk_widget_show (window);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -459,7 +473,7 @@ edit_guide (ConstraintEditorWindow *win,
|
|||||||
gtk_window_set_child (GTK_WINDOW (window), GTK_WIDGET (editor));
|
gtk_window_set_child (GTK_WINDOW (window), GTK_WIDGET (editor));
|
||||||
|
|
||||||
g_signal_connect (editor, "done", G_CALLBACK (guide_editor_done), win);
|
g_signal_connect (editor, "done", G_CALLBACK (guide_editor_done), win);
|
||||||
gtk_window_present (GTK_WINDOW (window));
|
gtk_widget_show (window);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|||||||
@@ -33,12 +33,22 @@ static void create_window (GApplication *app, const char *contents);
|
|||||||
static void
|
static void
|
||||||
show_action_dialog (GSimpleAction *action)
|
show_action_dialog (GSimpleAction *action)
|
||||||
{
|
{
|
||||||
GtkAlertDialog *dialog;
|
const char *name;
|
||||||
|
GtkWidget *dialog;
|
||||||
|
|
||||||
dialog = gtk_alert_dialog_new ("You activated action: \"%s\n",
|
name = g_action_get_name (G_ACTION (action));
|
||||||
g_action_get_name (G_ACTION (action)));
|
|
||||||
gtk_alert_dialog_show (dialog, NULL);
|
dialog = gtk_message_dialog_new (NULL,
|
||||||
g_object_unref (dialog);
|
GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||||
|
GTK_MESSAGE_INFO,
|
||||||
|
GTK_BUTTONS_CLOSE,
|
||||||
|
"You activated action: \"%s\"",
|
||||||
|
name);
|
||||||
|
|
||||||
|
g_signal_connect (dialog, "response",
|
||||||
|
G_CALLBACK (gtk_window_destroy), NULL);
|
||||||
|
|
||||||
|
gtk_widget_show (dialog);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -57,7 +67,7 @@ show_action_infobar (GSimpleAction *action,
|
|||||||
text = g_strdup_printf ("You activated radio action: \"%s\".\n"
|
text = g_strdup_printf ("You activated radio action: \"%s\".\n"
|
||||||
"Current value: %s", name, value);
|
"Current value: %s", name, value);
|
||||||
gtk_label_set_text (GTK_LABEL (window->message), text);
|
gtk_label_set_text (GTK_LABEL (window->message), text);
|
||||||
gtk_widget_set_visible (window->infobar, TRUE);
|
gtk_widget_show (window->infobar);
|
||||||
g_free (text);
|
g_free (text);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -80,38 +90,43 @@ activate_new (GSimpleAction *action,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
open_response_cb (GObject *source,
|
open_response_cb (GtkNativeDialog *dialog,
|
||||||
GAsyncResult *result,
|
int response_id,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
GtkFileDialog *dialog = GTK_FILE_DIALOG (source);
|
GtkFileChooserNative *native = user_data;
|
||||||
GApplication *app = G_APPLICATION (user_data);
|
GApplication *app = g_object_get_data (G_OBJECT (native), "app");
|
||||||
|
GtkWidget *message_dialog;
|
||||||
GFile *file;
|
GFile *file;
|
||||||
|
char *contents;
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
|
||||||
file = gtk_file_dialog_open_finish (dialog, result, &error);
|
if (response_id == GTK_RESPONSE_ACCEPT)
|
||||||
if (file)
|
|
||||||
{
|
{
|
||||||
char *contents;
|
file = gtk_file_chooser_get_file (GTK_FILE_CHOOSER (native));
|
||||||
|
|
||||||
if (g_file_load_contents (file, NULL, &contents, NULL, NULL, &error))
|
if (g_file_load_contents (file, NULL, &contents, NULL, NULL, &error))
|
||||||
{
|
{
|
||||||
create_window (app, contents);
|
create_window (app, contents);
|
||||||
g_free (contents);
|
g_free (contents);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
message_dialog = gtk_message_dialog_new (NULL,
|
||||||
|
GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||||
|
GTK_MESSAGE_ERROR,
|
||||||
|
GTK_BUTTONS_CLOSE,
|
||||||
|
"Error loading file: \"%s\"",
|
||||||
|
error->message);
|
||||||
|
g_signal_connect (message_dialog, "response",
|
||||||
|
G_CALLBACK (gtk_window_destroy), NULL);
|
||||||
|
gtk_widget_show (message_dialog);
|
||||||
|
g_error_free (error);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (error)
|
gtk_native_dialog_destroy (GTK_NATIVE_DIALOG (native));
|
||||||
{
|
g_object_unref (native);
|
||||||
GtkAlertDialog *alert;
|
|
||||||
|
|
||||||
alert = gtk_alert_dialog_new ("Error loading file: \"%s\"", error->message);
|
|
||||||
gtk_alert_dialog_show (alert, NULL);
|
|
||||||
g_object_unref (alert);
|
|
||||||
g_error_free (error);
|
|
||||||
}
|
|
||||||
|
|
||||||
g_object_unref (app);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -121,11 +136,21 @@ activate_open (GSimpleAction *action,
|
|||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
GApplication *app = user_data;
|
GApplication *app = user_data;
|
||||||
GtkFileDialog *dialog;
|
GtkFileChooserNative *native;
|
||||||
|
|
||||||
dialog = gtk_file_dialog_new ();
|
native = gtk_file_chooser_native_new ("Open File",
|
||||||
gtk_file_dialog_open (dialog, NULL, NULL, open_response_cb, g_object_ref (app));
|
NULL,
|
||||||
g_object_unref (dialog);
|
GTK_FILE_CHOOSER_ACTION_OPEN,
|
||||||
|
"_Open",
|
||||||
|
"_Cancel");
|
||||||
|
|
||||||
|
g_object_set_data_full (G_OBJECT (native), "app", g_object_ref (app), g_object_unref);
|
||||||
|
g_signal_connect (native,
|
||||||
|
"response",
|
||||||
|
G_CALLBACK (open_response_cb),
|
||||||
|
native);
|
||||||
|
|
||||||
|
gtk_native_dialog_show (GTK_NATIVE_DIALOG (native));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -295,7 +320,7 @@ static GActionEntry win_entries[] = {
|
|||||||
static void
|
static void
|
||||||
clicked_cb (GtkWidget *widget, DemoApplicationWindow *window)
|
clicked_cb (GtkWidget *widget, DemoApplicationWindow *window)
|
||||||
{
|
{
|
||||||
gtk_widget_set_visible (window->infobar, FALSE);
|
gtk_widget_hide (window->infobar);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|||||||
@@ -140,6 +140,7 @@ create_page3 (GtkWidget *assistant)
|
|||||||
|
|
||||||
label = gtk_label_new ("This is a confirmation page, press 'Apply' to apply changes");
|
label = gtk_label_new ("This is a confirmation page, press 'Apply' to apply changes");
|
||||||
|
|
||||||
|
gtk_widget_show (label);
|
||||||
gtk_assistant_append_page (GTK_ASSISTANT (assistant), label);
|
gtk_assistant_append_page (GTK_ASSISTANT (assistant), label);
|
||||||
gtk_assistant_set_page_type (GTK_ASSISTANT (assistant), label, GTK_ASSISTANT_PAGE_CONFIRM);
|
gtk_assistant_set_page_type (GTK_ASSISTANT (assistant), label, GTK_ASSISTANT_PAGE_CONFIRM);
|
||||||
gtk_assistant_set_page_complete (GTK_ASSISTANT (assistant), label, TRUE);
|
gtk_assistant_set_page_complete (GTK_ASSISTANT (assistant), label, TRUE);
|
||||||
@@ -156,6 +157,7 @@ create_page4 (GtkWidget *assistant)
|
|||||||
gtk_widget_set_margin_start (progress_bar, 40);
|
gtk_widget_set_margin_start (progress_bar, 40);
|
||||||
gtk_widget_set_margin_end (progress_bar, 40);
|
gtk_widget_set_margin_end (progress_bar, 40);
|
||||||
|
|
||||||
|
gtk_widget_show (progress_bar);
|
||||||
gtk_assistant_append_page (GTK_ASSISTANT (assistant), progress_bar);
|
gtk_assistant_append_page (GTK_ASSISTANT (assistant), progress_bar);
|
||||||
gtk_assistant_set_page_type (GTK_ASSISTANT (assistant), progress_bar, GTK_ASSISTANT_PAGE_PROGRESS);
|
gtk_assistant_set_page_type (GTK_ASSISTANT (assistant), progress_bar, GTK_ASSISTANT_PAGE_PROGRESS);
|
||||||
gtk_assistant_set_page_title (GTK_ASSISTANT (assistant), progress_bar, "Applying changes");
|
gtk_assistant_set_page_title (GTK_ASSISTANT (assistant), progress_bar, "Applying changes");
|
||||||
@@ -197,7 +199,7 @@ do_assistant (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (assistant))
|
if (!gtk_widget_get_visible (assistant))
|
||||||
gtk_widget_set_visible (assistant, TRUE);
|
gtk_widget_show (assistant);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (assistant));
|
gtk_window_destroy (GTK_WINDOW (assistant));
|
||||||
|
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ do_builder (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
/* Clipboard
|
/* Clipboard
|
||||||
* #Keywords: drag-and-drop, dnd
|
|
||||||
*
|
*
|
||||||
* GdkClipboard is used for clipboard handling. This demo shows how to
|
* GdkClipboard is used for clipboard handling. This demo shows how to
|
||||||
* copy and paste text, images, colors or files to and from the clipboard.
|
* copy and paste text, images, colors or files to and from the clipboard.
|
||||||
@@ -51,10 +50,10 @@ copy_button_clicked (GtkStack *source_stack,
|
|||||||
}
|
}
|
||||||
else if (strcmp (visible_child_name, "Color") == 0)
|
else if (strcmp (visible_child_name, "Color") == 0)
|
||||||
{
|
{
|
||||||
const GdkRGBA *color;
|
GdkRGBA color;
|
||||||
|
|
||||||
color = gtk_color_dialog_button_get_rgba (GTK_COLOR_DIALOG_BUTTON (visible_child));
|
gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (visible_child), &color);
|
||||||
gdk_clipboard_set (clipboard, GDK_TYPE_RGBA, color);
|
gdk_clipboard_set (clipboard, GDK_TYPE_RGBA, &color);
|
||||||
}
|
}
|
||||||
else if (strcmp (visible_child_name, "File") == 0)
|
else if (strcmp (visible_child_name, "File") == 0)
|
||||||
{
|
{
|
||||||
@@ -216,71 +215,37 @@ file_button_set_file (GtkButton *button,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
file_chooser_response (GObject *source,
|
file_chooser_response (GtkNativeDialog *dialog,
|
||||||
GAsyncResult *result,
|
int response,
|
||||||
gpointer user_data)
|
GtkButton *button)
|
||||||
{
|
{
|
||||||
GtkFileDialog *dialog = GTK_FILE_DIALOG (source);
|
gtk_native_dialog_hide (dialog);
|
||||||
GtkButton *button = GTK_BUTTON (user_data);
|
|
||||||
GFile *file;
|
|
||||||
|
|
||||||
file = gtk_file_dialog_open_finish (dialog, result, NULL);
|
if (response == GTK_RESPONSE_ACCEPT)
|
||||||
if (file)
|
|
||||||
{
|
{
|
||||||
|
GFile *file = gtk_file_chooser_get_file (GTK_FILE_CHOOSER (dialog));
|
||||||
file_button_set_file (button, file);
|
file_button_set_file (button, file);
|
||||||
g_object_unref (file);
|
g_object_unref (file);
|
||||||
|
|
||||||
update_copy_button_sensitivity (gtk_widget_get_ancestor (GTK_WIDGET (button), GTK_TYPE_STACK));
|
update_copy_button_sensitivity (gtk_widget_get_ancestor (GTK_WIDGET (button), GTK_TYPE_STACK));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gtk_native_dialog_destroy (dialog);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
open_file_cb (GtkWidget *button)
|
open_file_cb (GtkWidget *button)
|
||||||
{
|
{
|
||||||
GtkFileDialog *dialog;
|
GtkFileChooserNative *chooser;
|
||||||
|
|
||||||
dialog = gtk_file_dialog_new ();
|
chooser = gtk_file_chooser_native_new ("Choose a file",
|
||||||
|
GTK_WINDOW (gtk_widget_get_ancestor (button, GTK_TYPE_WINDOW)),
|
||||||
|
GTK_FILE_CHOOSER_ACTION_OPEN,
|
||||||
|
"_Open",
|
||||||
|
"_Cancel");
|
||||||
|
|
||||||
gtk_file_dialog_open (dialog,
|
g_signal_connect (chooser, "response", G_CALLBACK (file_chooser_response), button);
|
||||||
GTK_WINDOW (gtk_widget_get_ancestor (button, GTK_TYPE_WINDOW)),
|
gtk_native_dialog_show (GTK_NATIVE_DIALOG (chooser));
|
||||||
NULL,
|
|
||||||
file_chooser_response, button);
|
|
||||||
|
|
||||||
g_object_unref (dialog);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
folder_chooser_response (GObject *source,
|
|
||||||
GAsyncResult *result,
|
|
||||||
gpointer user_data)
|
|
||||||
{
|
|
||||||
GtkFileDialog *dialog = GTK_FILE_DIALOG (source);
|
|
||||||
GtkButton *button = GTK_BUTTON (user_data);
|
|
||||||
GFile *file;
|
|
||||||
|
|
||||||
file = gtk_file_dialog_select_folder_finish (dialog, result, NULL);
|
|
||||||
if (file)
|
|
||||||
{
|
|
||||||
file_button_set_file (button, file);
|
|
||||||
g_object_unref (file);
|
|
||||||
|
|
||||||
update_copy_button_sensitivity (gtk_widget_get_ancestor (GTK_WIDGET (button), GTK_TYPE_STACK));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
open_folder_cb (GtkWidget *button)
|
|
||||||
{
|
|
||||||
GtkFileDialog *dialog;
|
|
||||||
|
|
||||||
dialog = gtk_file_dialog_new ();
|
|
||||||
|
|
||||||
gtk_file_dialog_select_folder (dialog,
|
|
||||||
GTK_WINDOW (gtk_widget_get_ancestor (button, GTK_TYPE_WINDOW)),
|
|
||||||
NULL,
|
|
||||||
folder_chooser_response, button);
|
|
||||||
|
|
||||||
g_object_unref (dialog);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -381,7 +346,6 @@ do_clipboard (GtkWidget *do_widget)
|
|||||||
gtk_builder_cscope_add_callback (scope, source_changed_cb);
|
gtk_builder_cscope_add_callback (scope, source_changed_cb);
|
||||||
gtk_builder_cscope_add_callback (scope, text_changed_cb);
|
gtk_builder_cscope_add_callback (scope, text_changed_cb);
|
||||||
gtk_builder_cscope_add_callback (scope, open_file_cb);
|
gtk_builder_cscope_add_callback (scope, open_file_cb);
|
||||||
gtk_builder_cscope_add_callback (scope, open_folder_cb);
|
|
||||||
gtk_builder_cscope_add_callback (scope, on_drop);
|
gtk_builder_cscope_add_callback (scope, on_drop);
|
||||||
gtk_builder_cscope_add_callback (scope, drag_prepare);
|
gtk_builder_cscope_add_callback (scope, drag_prepare);
|
||||||
builder = gtk_builder_new ();
|
builder = gtk_builder_new ();
|
||||||
@@ -405,7 +369,7 @@ do_clipboard (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,6 @@
|
|||||||
<item>Color</item>
|
<item>Color</item>
|
||||||
<item>Image</item>
|
<item>Image</item>
|
||||||
<item>File</item>
|
<item>File</item>
|
||||||
<item>Folder</item>
|
|
||||||
</items>
|
</items>
|
||||||
</object>
|
</object>
|
||||||
</property>
|
</property>
|
||||||
@@ -65,11 +64,7 @@
|
|||||||
<object class="GtkStackPage">
|
<object class="GtkStackPage">
|
||||||
<property name="name">Color</property>
|
<property name="name">Color</property>
|
||||||
<property name="child">
|
<property name="child">
|
||||||
<object class="GtkColorDialogButton" id="source_color">
|
<object class="GtkColorButton" id="source_color">
|
||||||
<property name="dialog">
|
|
||||||
<object class="GtkColorDialog">
|
|
||||||
</object>
|
|
||||||
</property>
|
|
||||||
<property name="valign">center</property>
|
<property name="valign">center</property>
|
||||||
<property name="rgba">purple</property>
|
<property name="rgba">purple</property>
|
||||||
</object>
|
</object>
|
||||||
@@ -167,30 +162,6 @@
|
|||||||
</property>
|
</property>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
|
||||||
<object class="GtkStackPage">
|
|
||||||
<property name="name">Folder</property>
|
|
||||||
<property name="child">
|
|
||||||
<object class="GtkButton" id="source_folder">
|
|
||||||
<child>
|
|
||||||
<object class="GtkDragSource">
|
|
||||||
<property name="propagation-phase">capture</property>
|
|
||||||
<signal name="prepare" handler="drag_prepare"/>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
<property name="valign">center</property>
|
|
||||||
<property name="child">
|
|
||||||
<object class="GtkLabel">
|
|
||||||
<property name="label">—</property>
|
|
||||||
<property name="xalign">0</property>
|
|
||||||
<property name="ellipsize">start</property>
|
|
||||||
</object>
|
|
||||||
</property>
|
|
||||||
<signal name="clicked" handler="open_folder_cb"/>
|
|
||||||
</object>
|
|
||||||
</property>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
|
|||||||
@@ -449,7 +449,7 @@ do_combobox (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -277,7 +277,7 @@ do_constraints (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ do_constraints_builder (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -229,7 +229,7 @@ do_constraints_interactive (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ do_constraints_vfl (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ do_css_accordion (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ do_css_basics (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ do_css_blendmodes (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -155,7 +155,7 @@ do_css_multiplebgs (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ do_css_pixbufs (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -142,7 +142,7 @@ do_css_shadows (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ do_cursors (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -8,8 +8,6 @@
|
|||||||
#include <glib/gi18n.h>
|
#include <glib/gi18n.h>
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
|
||||||
|
|
||||||
static GtkWidget *window = NULL;
|
static GtkWidget *window = NULL;
|
||||||
static GtkWidget *entry1 = NULL;
|
static GtkWidget *entry1 = NULL;
|
||||||
static GtkWidget *entry2 = NULL;
|
static GtkWidget *entry2 = NULL;
|
||||||
@@ -29,7 +27,7 @@ message_dialog_clicked (GtkButton *button,
|
|||||||
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
|
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
|
||||||
ngettext ("Has been shown once", "Has been shown %d times", i), i);
|
ngettext ("Has been shown once", "Has been shown %d times", i), i);
|
||||||
g_signal_connect (dialog, "response", G_CALLBACK (gtk_window_destroy), NULL);
|
g_signal_connect (dialog, "response", G_CALLBACK (gtk_window_destroy), NULL);
|
||||||
gtk_window_present (GTK_WINDOW (dialog));
|
gtk_widget_show (dialog);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -116,7 +114,7 @@ interactive_dialog_clicked (GtkButton *button,
|
|||||||
data, (GClosureNotify) g_free,
|
data, (GClosureNotify) g_free,
|
||||||
0);
|
0);
|
||||||
|
|
||||||
gtk_window_present (GTK_WINDOW (dialog));
|
gtk_widget_show (dialog);
|
||||||
}
|
}
|
||||||
|
|
||||||
GtkWidget *
|
GtkWidget *
|
||||||
@@ -186,7 +184,7 @@ do_dialog (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -726,9 +726,7 @@ do_dnd (GtkWidget *do_widget)
|
|||||||
GtkCssProvider *provider;
|
GtkCssProvider *provider;
|
||||||
GString *css;
|
GString *css;
|
||||||
|
|
||||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
|
||||||
button = gtk_color_button_new ();
|
button = gtk_color_button_new ();
|
||||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
|
||||||
g_object_unref (g_object_ref_sink (button));
|
g_object_unref (g_object_ref_sink (button));
|
||||||
|
|
||||||
provider = gtk_css_provider_new ();
|
provider = gtk_css_provider_new ();
|
||||||
@@ -802,7 +800,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -372,7 +372,7 @@ do_drawingarea (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -164,14 +164,14 @@ strings_bind_item (GtkSignalListItemFactory *factory,
|
|||||||
popup = gtk_widget_get_ancestor (title, GTK_TYPE_POPOVER);
|
popup = gtk_widget_get_ancestor (title, GTK_TYPE_POPOVER);
|
||||||
if (popup && gtk_widget_is_ancestor (popup, GTK_WIDGET (dropdown)))
|
if (popup && gtk_widget_is_ancestor (popup, GTK_WIDGET (dropdown)))
|
||||||
{
|
{
|
||||||
gtk_widget_set_visible (checkmark, TRUE);
|
gtk_widget_show (checkmark);
|
||||||
g_signal_connect (dropdown, "notify::selected-item",
|
g_signal_connect (dropdown, "notify::selected-item",
|
||||||
G_CALLBACK (selected_item_changed), item);
|
G_CALLBACK (selected_item_changed), item);
|
||||||
selected_item_changed (dropdown, NULL, item);
|
selected_item_changed (dropdown, NULL, item);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
gtk_widget_set_visible (checkmark, FALSE);
|
gtk_widget_hide (checkmark);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -563,7 +563,7 @@ do_dropdown (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -409,7 +409,7 @@ do_editable_cells (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ do_entry_completion (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ do_entry_undo (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -42,12 +42,12 @@ mode_switch_state_set (GtkSwitch *sw,
|
|||||||
if (!state ||
|
if (!state ||
|
||||||
(gtk_range_get_value (GTK_RANGE (scale)) > 50))
|
(gtk_range_get_value (GTK_RANGE (scale)) > 50))
|
||||||
{
|
{
|
||||||
gtk_widget_set_visible (label, FALSE);
|
gtk_widget_hide (label);
|
||||||
gtk_switch_set_state (sw, state);
|
gtk_switch_set_state (sw, state);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
gtk_widget_set_visible (label, TRUE);
|
gtk_widget_show (label);
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@@ -65,7 +65,7 @@ level_scale_value_changed (GtkRange *range,
|
|||||||
!gtk_switch_get_state (GTK_SWITCH (sw)) &&
|
!gtk_switch_get_state (GTK_SWITCH (sw)) &&
|
||||||
(gtk_range_get_value (range) > 50))
|
(gtk_range_get_value (range) > 50))
|
||||||
{
|
{
|
||||||
gtk_widget_set_visible (label, FALSE);
|
gtk_widget_hide (label);
|
||||||
gtk_switch_set_state (GTK_SWITCH (sw), TRUE);
|
gtk_switch_set_state (GTK_SWITCH (sw), TRUE);
|
||||||
}
|
}
|
||||||
else if (gtk_switch_get_state (GTK_SWITCH (sw)) &&
|
else if (gtk_switch_get_state (GTK_SWITCH (sw)) &&
|
||||||
@@ -113,7 +113,7 @@ do_errorstates (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -10,8 +10,6 @@
|
|||||||
#include <glib/gi18n.h>
|
#include <glib/gi18n.h>
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
|
||||||
|
|
||||||
static GtkWidget *window = NULL;
|
static GtkWidget *window = NULL;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -122,7 +120,7 @@ do_expander (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -199,7 +199,7 @@ do_filtermodel (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -68,13 +68,11 @@ create_blurred_button (void)
|
|||||||
return w;
|
return w;
|
||||||
}
|
}
|
||||||
|
|
||||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
|
||||||
static GtkWidget *
|
static GtkWidget *
|
||||||
create_font_button (void)
|
create_font_button (void)
|
||||||
{
|
{
|
||||||
return gtk_font_button_new ();
|
return gtk_font_button_new ();
|
||||||
}
|
}
|
||||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
|
||||||
|
|
||||||
static GtkWidget *
|
static GtkWidget *
|
||||||
create_level_bar (void)
|
create_level_bar (void)
|
||||||
@@ -329,7 +327,7 @@ do_fishbowl (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -160,7 +160,7 @@ do_fixed (GtkWidget *do_widget)
|
|||||||
demo_window = create_demo_window (do_widget);
|
demo_window = create_demo_window (do_widget);
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (demo_window))
|
if (!gtk_widget_get_visible (demo_window))
|
||||||
gtk_widget_set_visible (demo_window, TRUE);
|
gtk_widget_show (demo_window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (demo_window));
|
gtk_window_destroy (GTK_WINDOW (demo_window));
|
||||||
|
|
||||||
|
|||||||
@@ -742,7 +742,7 @@ do_flowbox (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -21,8 +21,6 @@
|
|||||||
#include "script-names.h"
|
#include "script-names.h"
|
||||||
#include "language-names.h"
|
#include "language-names.h"
|
||||||
|
|
||||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
|
||||||
|
|
||||||
/* {{{ ScriptLang object */
|
/* {{{ ScriptLang object */
|
||||||
|
|
||||||
G_DECLARE_FINAL_TYPE (ScriptLang, script_lang, SCRIPT, LANG, GObject)
|
G_DECLARE_FINAL_TYPE (ScriptLang, script_lang, SCRIPT, LANG, GObject)
|
||||||
@@ -258,10 +256,10 @@ swap_colors (void)
|
|||||||
GdkRGBA fg;
|
GdkRGBA fg;
|
||||||
GdkRGBA bg;
|
GdkRGBA bg;
|
||||||
|
|
||||||
fg = *gtk_color_dialog_button_get_rgba (GTK_COLOR_DIALOG_BUTTON (demo->foreground));
|
gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (demo->foreground), &fg);
|
||||||
bg = *gtk_color_dialog_button_get_rgba (GTK_COLOR_DIALOG_BUTTON (demo->background));
|
gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (demo->background), &bg);
|
||||||
gtk_color_dialog_button_set_rgba (GTK_COLOR_DIALOG_BUTTON (demo->foreground), &bg);
|
gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (demo->foreground), &bg);
|
||||||
gtk_color_dialog_button_set_rgba (GTK_COLOR_DIALOG_BUTTON (demo->background), &fg);
|
gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (demo->background), &fg);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -270,8 +268,8 @@ font_features_reset_basic (void)
|
|||||||
gtk_adjustment_set_value (demo->size_adjustment, 20);
|
gtk_adjustment_set_value (demo->size_adjustment, 20);
|
||||||
gtk_adjustment_set_value (demo->letterspacing_adjustment, 0);
|
gtk_adjustment_set_value (demo->letterspacing_adjustment, 0);
|
||||||
gtk_adjustment_set_value (demo->line_height_adjustment, 1);
|
gtk_adjustment_set_value (demo->line_height_adjustment, 1);
|
||||||
gtk_color_dialog_button_set_rgba (GTK_COLOR_DIALOG_BUTTON (demo->foreground), &(GdkRGBA){0.,0.,0.,1.});
|
gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (demo->foreground), &(GdkRGBA){0.,0.,0.,1.});
|
||||||
gtk_color_dialog_button_set_rgba (GTK_COLOR_DIALOG_BUTTON (demo->background), &(GdkRGBA){1.,1.,1.,1.});
|
gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (demo->background), &(GdkRGBA){1.,1.,1.,1.});
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -279,7 +277,7 @@ update_basic (void)
|
|||||||
{
|
{
|
||||||
PangoFontDescription *desc;
|
PangoFontDescription *desc;
|
||||||
|
|
||||||
desc = gtk_font_dialog_button_get_font_desc (GTK_FONT_DIALOG_BUTTON (demo->font));
|
desc = gtk_font_chooser_get_font_desc (GTK_FONT_CHOOSER (demo->font));
|
||||||
|
|
||||||
gtk_adjustment_set_value (demo->size_adjustment,
|
gtk_adjustment_set_value (demo->size_adjustment,
|
||||||
pango_font_description_get_size (desc) / (double) PANGO_SCALE);
|
pango_font_description_get_size (desc) / (double) PANGO_SCALE);
|
||||||
@@ -590,7 +588,7 @@ update_display (void)
|
|||||||
end = PANGO_ATTR_INDEX_TO_TEXT_END;
|
end = PANGO_ATTR_INDEX_TO_TEXT_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
desc = gtk_font_dialog_button_get_font_desc (GTK_FONT_DIALOG_BUTTON (demo->font));
|
desc = gtk_font_chooser_get_font_desc (GTK_FONT_CHOOSER (demo->font));
|
||||||
|
|
||||||
value = gtk_adjustment_get_value (demo->size_adjustment);
|
value = gtk_adjustment_get_value (demo->size_adjustment);
|
||||||
pango_font_description_set_size (desc, value * PANGO_SCALE);
|
pango_font_description_set_size (desc, value * PANGO_SCALE);
|
||||||
@@ -681,7 +679,7 @@ update_display (void)
|
|||||||
GdkRGBA rgba;
|
GdkRGBA rgba;
|
||||||
char *fg, *bg, *css;
|
char *fg, *bg, *css;
|
||||||
|
|
||||||
rgba = *gtk_color_dialog_button_get_rgba (GTK_COLOR_DIALOG_BUTTON (demo->foreground));
|
gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (demo->foreground), &rgba);
|
||||||
attr = pango_attr_foreground_new (65535 * rgba.red,
|
attr = pango_attr_foreground_new (65535 * rgba.red,
|
||||||
65535 * rgba.green,
|
65535 * rgba.green,
|
||||||
65535 * rgba.blue);
|
65535 * rgba.blue);
|
||||||
@@ -694,7 +692,7 @@ update_display (void)
|
|||||||
pango_attr_list_insert (attrs, attr);
|
pango_attr_list_insert (attrs, attr);
|
||||||
|
|
||||||
fg = gdk_rgba_to_string (&rgba);
|
fg = gdk_rgba_to_string (&rgba);
|
||||||
rgba = *gtk_color_dialog_button_get_rgba (GTK_COLOR_DIALOG_BUTTON (demo->background));
|
gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (demo->background), &rgba);
|
||||||
bg = gdk_rgba_to_string (&rgba);
|
bg = gdk_rgba_to_string (&rgba);
|
||||||
css = g_strdup_printf (".font_features_background { caret-color: %s; background-color: %s; }", fg, bg);
|
css = g_strdup_printf (".font_features_background { caret-color: %s; background-color: %s; }", fg, bg);
|
||||||
gtk_css_provider_load_from_data (demo->provider, css, strlen (css));
|
gtk_css_provider_load_from_data (demo->provider, css, strlen (css));
|
||||||
@@ -769,6 +767,7 @@ update_display (void)
|
|||||||
gtk_label_set_attributes (GTK_LABEL (demo->the_label), attrs);
|
gtk_label_set_attributes (GTK_LABEL (demo->the_label), attrs);
|
||||||
|
|
||||||
g_free (font_desc);
|
g_free (font_desc);
|
||||||
|
pango_font_description_free (desc);
|
||||||
g_free (features);
|
g_free (features);
|
||||||
pango_attr_list_unref (attrs);
|
pango_attr_list_unref (attrs);
|
||||||
g_free (text);
|
g_free (text);
|
||||||
@@ -780,7 +779,7 @@ get_pango_font (void)
|
|||||||
PangoFontDescription *desc;
|
PangoFontDescription *desc;
|
||||||
PangoContext *context;
|
PangoContext *context;
|
||||||
|
|
||||||
desc = gtk_font_dialog_button_get_font_desc (GTK_FONT_DIALOG_BUTTON (demo->font));
|
desc = gtk_font_chooser_get_font_desc (GTK_FONT_CHOOSER (demo->font));
|
||||||
context = gtk_widget_get_pango_context (demo->font);
|
context = gtk_widget_get_pango_context (demo->font);
|
||||||
|
|
||||||
return pango_context_load_font (context, desc);
|
return pango_context_load_font (context, desc);
|
||||||
@@ -832,17 +831,17 @@ update_script_combo (void)
|
|||||||
GHashTable *tags;
|
GHashTable *tags;
|
||||||
GHashTableIter iter;
|
GHashTableIter iter;
|
||||||
TagPair *pair;
|
TagPair *pair;
|
||||||
PangoLanguage *language;
|
char *lang;
|
||||||
const char *lang;
|
|
||||||
hb_tag_t active;
|
hb_tag_t active;
|
||||||
|
|
||||||
language = gtk_font_dialog_button_get_language (GTK_FONT_DIALOG_BUTTON (demo->font));
|
lang = gtk_font_chooser_get_language (GTK_FONT_CHOOSER (demo->font));
|
||||||
lang = pango_language_to_string (language);
|
|
||||||
|
|
||||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||||
active = hb_ot_tag_from_language (hb_language_from_string (lang, -1));
|
active = hb_ot_tag_from_language (hb_language_from_string (lang, -1));
|
||||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||||
|
|
||||||
|
g_free (lang);
|
||||||
|
|
||||||
store = g_list_store_new (script_lang_get_type ());
|
store = g_list_store_new (script_lang_get_type ());
|
||||||
|
|
||||||
pango_font = get_pango_font ();
|
pango_font = get_pango_font ();
|
||||||
@@ -855,6 +854,11 @@ update_script_combo (void)
|
|||||||
pair->lang_tag = 0;
|
pair->lang_tag = 0;
|
||||||
g_hash_table_add (tags, pair);
|
g_hash_table_add (tags, pair);
|
||||||
|
|
||||||
|
pair = g_new (TagPair, 1);
|
||||||
|
pair->script_tag = HB_OT_TAG_DEFAULT_SCRIPT;
|
||||||
|
pair->lang_tag = HB_OT_TAG_DEFAULT_LANGUAGE;
|
||||||
|
g_hash_table_add (tags, pair);
|
||||||
|
|
||||||
if (hb_font)
|
if (hb_font)
|
||||||
{
|
{
|
||||||
hb_tag_t tables[2] = { HB_OT_TAG_GSUB, HB_OT_TAG_GPOS };
|
hb_tag_t tables[2] = { HB_OT_TAG_GSUB, HB_OT_TAG_GPOS };
|
||||||
@@ -966,6 +970,9 @@ update_features (void)
|
|||||||
|
|
||||||
/* set feature presence checks from the font features */
|
/* set feature presence checks from the font features */
|
||||||
|
|
||||||
|
if (gtk_drop_down_get_selected (GTK_DROP_DOWN (demo->script_lang)) == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
selected = gtk_drop_down_get_selected_item (GTK_DROP_DOWN (demo->script_lang));
|
selected = gtk_drop_down_get_selected_item (GTK_DROP_DOWN (demo->script_lang));
|
||||||
|
|
||||||
if (selected->lang_tag == 0) /* None is selected */
|
if (selected->lang_tag == 0) /* None is selected */
|
||||||
@@ -973,8 +980,8 @@ update_features (void)
|
|||||||
for (l = demo->feature_items; l; l = l->next)
|
for (l = demo->feature_items; l; l = l->next)
|
||||||
{
|
{
|
||||||
FeatureItem *item = l->data;
|
FeatureItem *item = l->data;
|
||||||
gtk_widget_set_visible (item->feat, TRUE);
|
gtk_widget_show (item->feat);
|
||||||
gtk_widget_set_visible (gtk_widget_get_parent (item->feat), TRUE);
|
gtk_widget_show (gtk_widget_get_parent (item->feat));
|
||||||
if (strcmp (item->name, "xxxx") == 0)
|
if (strcmp (item->name, "xxxx") == 0)
|
||||||
gtk_check_button_set_active (GTK_CHECK_BUTTON (item->feat), TRUE);
|
gtk_check_button_set_active (GTK_CHECK_BUTTON (item->feat), TRUE);
|
||||||
}
|
}
|
||||||
@@ -985,8 +992,8 @@ update_features (void)
|
|||||||
for (l = demo->feature_items; l; l = l->next)
|
for (l = demo->feature_items; l; l = l->next)
|
||||||
{
|
{
|
||||||
FeatureItem *item = l->data;
|
FeatureItem *item = l->data;
|
||||||
gtk_widget_set_visible (item->feat, FALSE);
|
gtk_widget_hide (item->feat);
|
||||||
gtk_widget_set_visible (gtk_widget_get_parent (item->feat), FALSE);
|
gtk_widget_hide (gtk_widget_get_parent (item->feat));
|
||||||
if (strcmp (item->name, "xxxx") == 0)
|
if (strcmp (item->name, "xxxx") == 0)
|
||||||
gtk_check_button_set_active (GTK_CHECK_BUTTON (item->feat), TRUE);
|
gtk_check_button_set_active (GTK_CHECK_BUTTON (item->feat), TRUE);
|
||||||
}
|
}
|
||||||
@@ -994,13 +1001,11 @@ update_features (void)
|
|||||||
pango_font = get_pango_font ();
|
pango_font = get_pango_font ();
|
||||||
hb_font = pango_font_get_hb_font (pango_font);
|
hb_font = pango_font_get_hb_font (pango_font);
|
||||||
|
|
||||||
g_print ("language %s\n", selected->langname);
|
|
||||||
|
|
||||||
if (hb_font)
|
if (hb_font)
|
||||||
{
|
{
|
||||||
hb_tag_t tables[2] = { HB_OT_TAG_GSUB, HB_OT_TAG_GPOS };
|
hb_tag_t tables[2] = { HB_OT_TAG_GSUB, HB_OT_TAG_GPOS };
|
||||||
hb_face_t *hb_face;
|
hb_face_t *hb_face;
|
||||||
const char *feat;
|
char *feat;
|
||||||
|
|
||||||
hb_face = hb_font_get_face (hb_font);
|
hb_face = hb_font_get_face (hb_font);
|
||||||
|
|
||||||
@@ -1022,6 +1027,9 @@ update_features (void)
|
|||||||
char buf[5];
|
char buf[5];
|
||||||
hb_tag_to_string (features[j], buf);
|
hb_tag_to_string (features[j], buf);
|
||||||
buf[4] = 0;
|
buf[4] = 0;
|
||||||
|
#if 0
|
||||||
|
g_print ("%s present in %s\n", buf, i == 0 ? "GSUB" : "GPOS");
|
||||||
|
#endif
|
||||||
|
|
||||||
if (g_str_has_prefix (buf, "ss") || g_str_has_prefix (buf, "cv"))
|
if (g_str_has_prefix (buf, "ss") || g_str_has_prefix (buf, "cv"))
|
||||||
{
|
{
|
||||||
@@ -1071,15 +1079,15 @@ update_features (void)
|
|||||||
|
|
||||||
if (item->tag == features[j])
|
if (item->tag == features[j])
|
||||||
{
|
{
|
||||||
gtk_widget_set_visible (item->feat, TRUE);
|
gtk_widget_show (item->feat);
|
||||||
gtk_widget_set_visible (gtk_widget_get_parent (item->feat), TRUE);
|
gtk_widget_show (gtk_widget_get_parent (item->feat));
|
||||||
if (GTK_IS_CHECK_BUTTON (item->feat))
|
if (GTK_IS_CHECK_BUTTON (item->feat))
|
||||||
{
|
{
|
||||||
GtkWidget *def = GTK_WIDGET (g_object_get_data (G_OBJECT (item->feat), "default"));
|
GtkWidget *def = GTK_WIDGET (g_object_get_data (G_OBJECT (item->feat), "default"));
|
||||||
if (def)
|
if (def)
|
||||||
{
|
{
|
||||||
gtk_widget_set_visible (def, TRUE);
|
gtk_widget_show (def);
|
||||||
gtk_widget_set_visible (gtk_widget_get_parent (def), TRUE);
|
gtk_widget_show (gtk_widget_get_parent (def));
|
||||||
gtk_check_button_set_active (GTK_CHECK_BUTTON (def), TRUE);
|
gtk_check_button_set_active (GTK_CHECK_BUTTON (def), TRUE);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1090,7 +1098,7 @@ update_features (void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
feat = gtk_font_dialog_button_get_font_features (GTK_FONT_DIALOG_BUTTON (demo->font));
|
feat = gtk_font_chooser_get_font_features (GTK_FONT_CHOOSER (demo->font));
|
||||||
if (feat)
|
if (feat)
|
||||||
{
|
{
|
||||||
for (l = demo->feature_items; l; l = l->next)
|
for (l = demo->feature_items; l; l = l->next)
|
||||||
@@ -1116,6 +1124,8 @@ update_features (void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
g_free (feat);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1413,7 +1423,10 @@ instance_changed (GtkDropDown *combo)
|
|||||||
ikey.name = (char *) text;
|
ikey.name = (char *) text;
|
||||||
instance = g_hash_table_lookup (demo->instances, &ikey);
|
instance = g_hash_table_lookup (demo->instances, &ikey);
|
||||||
if (!instance)
|
if (!instance)
|
||||||
goto out;
|
{
|
||||||
|
g_print ("did not find instance %s\n", text);
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
pango_font = get_pango_font ();
|
pango_font = get_pango_font ();
|
||||||
hb_font = pango_font_get_hb_font (pango_font);
|
hb_font = pango_font_get_hb_font (pango_font);
|
||||||
@@ -1767,7 +1780,6 @@ do_font_features (GtkWidget *do_widget)
|
|||||||
demo->description = GTK_WIDGET (gtk_builder_get_object (builder, "description"));
|
demo->description = GTK_WIDGET (gtk_builder_get_object (builder, "description"));
|
||||||
demo->font = GTK_WIDGET (gtk_builder_get_object (builder, "font"));
|
demo->font = GTK_WIDGET (gtk_builder_get_object (builder, "font"));
|
||||||
demo->script_lang = GTK_WIDGET (gtk_builder_get_object (builder, "script_lang"));
|
demo->script_lang = GTK_WIDGET (gtk_builder_get_object (builder, "script_lang"));
|
||||||
g_assert (GTK_IS_DROP_DOWN (demo->script_lang));
|
|
||||||
expression = gtk_cclosure_expression_new (G_TYPE_STRING, NULL, 0, NULL, G_CALLBACK (script_lang_get_langname), NULL, NULL);
|
expression = gtk_cclosure_expression_new (G_TYPE_STRING, NULL, 0, NULL, G_CALLBACK (script_lang_get_langname), NULL, NULL);
|
||||||
gtk_drop_down_set_expression (GTK_DROP_DOWN (demo->script_lang), expression);
|
gtk_drop_down_set_expression (GTK_DROP_DOWN (demo->script_lang), expression);
|
||||||
gtk_expression_unref (expression);
|
gtk_expression_unref (expression);
|
||||||
|
|||||||
@@ -58,14 +58,11 @@
|
|||||||
<property name="orientation">vertical</property>
|
<property name="orientation">vertical</property>
|
||||||
<property name="spacing">6</property>
|
<property name="spacing">6</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkFontDialogButton" id="font">
|
<object class="GtkFontButton" id="font">
|
||||||
<property name="dialog">
|
|
||||||
<object class="GtkFontDialog">
|
|
||||||
</object>
|
|
||||||
</property>
|
|
||||||
<property name="receives-default">1</property>
|
<property name="receives-default">1</property>
|
||||||
<property name="level">face</property>
|
<property name="font">Sans 12</property>
|
||||||
<signal name="notify::font-desc" handler="font_features_font_changed" swapped="no"/>
|
<property name="level">family|style</property>
|
||||||
|
<signal name="font-set" handler="font_features_font_changed" swapped="no"/>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
@@ -195,11 +192,7 @@
|
|||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkColorDialogButton" id="foreground">
|
<object class="GtkColorButton" id="foreground">
|
||||||
<property name="dialog">
|
|
||||||
<object class="GtkColorDialog">
|
|
||||||
</object>
|
|
||||||
</property>
|
|
||||||
<property name="valign">baseline</property>
|
<property name="valign">baseline</property>
|
||||||
<property name="rgba">black</property>
|
<property name="rgba">black</property>
|
||||||
<signal name="notify::rgba" handler="color_set_cb"/>
|
<signal name="notify::rgba" handler="color_set_cb"/>
|
||||||
@@ -221,11 +214,7 @@
|
|||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkColorDialogButton" id="background">
|
<object class="GtkColorButton" id="background">
|
||||||
<property name="dialog">
|
|
||||||
<object class="GtkColorDialog">
|
|
||||||
</object>
|
|
||||||
</property>
|
|
||||||
<property name="valign">baseline</property>
|
<property name="valign">baseline</property>
|
||||||
<property name="rgba">white</property>
|
<property name="rgba">white</property>
|
||||||
<signal name="notify::rgba" handler="color_set_cb"/>
|
<signal name="notify::rgba" handler="color_set_cb"/>
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ update_image (void)
|
|||||||
context = gtk_widget_create_pango_context (image);
|
context = gtk_widget_create_pango_context (image);
|
||||||
|
|
||||||
text = gtk_editable_get_text (GTK_EDITABLE (entry));
|
text = gtk_editable_get_text (GTK_EDITABLE (entry));
|
||||||
desc = gtk_font_dialog_button_get_font_desc (GTK_FONT_DIALOG_BUTTON (font_button));
|
desc = gtk_font_chooser_get_font_desc (GTK_FONT_CHOOSER (font_button));
|
||||||
|
|
||||||
fopt = cairo_font_options_copy (pango_cairo_context_get_font_options (context));
|
fopt = cairo_font_options_copy (pango_cairo_context_get_font_options (context));
|
||||||
|
|
||||||
@@ -287,6 +287,8 @@ retry:
|
|||||||
gtk_picture_set_pixbuf (GTK_PICTURE (image), pixbuf2);
|
gtk_picture_set_pixbuf (GTK_PICTURE (image), pixbuf2);
|
||||||
|
|
||||||
g_object_unref (pixbuf2);
|
g_object_unref (pixbuf2);
|
||||||
|
|
||||||
|
pango_font_description_free (desc);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean fading = FALSE;
|
static gboolean fading = FALSE;
|
||||||
@@ -435,7 +437,7 @@ do_fontrendering (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -74,11 +74,7 @@
|
|||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkFontDialogButton" id="font_button">
|
<object class="GtkFontButton" id="font_button">
|
||||||
<property name="dialog">
|
|
||||||
<object class="GtkFontDialog">
|
|
||||||
</object>
|
|
||||||
</property>
|
|
||||||
<layout>
|
<layout>
|
||||||
<property name="column">2</property>
|
<property name="column">2</property>
|
||||||
<property name="row">1</property>
|
<property name="row">1</property>
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ do_frames (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ create_axis_slider (GtkGears *gears,
|
|||||||
|
|
||||||
label = gtk_label_new (text);
|
label = gtk_label_new (text);
|
||||||
gtk_box_append (GTK_BOX (box), label);
|
gtk_box_append (GTK_BOX (box), label);
|
||||||
|
gtk_widget_show (label);
|
||||||
|
|
||||||
adj = gtk_adjustment_new (gtk_gears_get_axis (gears, axis), 0.0, 360.0, 1.0, 12.0, 0.0);
|
adj = gtk_adjustment_new (gtk_gears_get_axis (gears, axis), 0.0, 360.0, 1.0, 12.0, 0.0);
|
||||||
g_object_set_data (G_OBJECT (adj), "axis", GINT_TO_POINTER (axis));
|
g_object_set_data (G_OBJECT (adj), "axis", GINT_TO_POINTER (axis));
|
||||||
@@ -64,6 +65,9 @@ create_axis_slider (GtkGears *gears,
|
|||||||
gtk_scale_set_draw_value (GTK_SCALE (slider), FALSE);
|
gtk_scale_set_draw_value (GTK_SCALE (slider), FALSE);
|
||||||
gtk_box_append (GTK_BOX (box), slider);
|
gtk_box_append (GTK_BOX (box), slider);
|
||||||
gtk_widget_set_vexpand (slider, TRUE);
|
gtk_widget_set_vexpand (slider, TRUE);
|
||||||
|
gtk_widget_show (slider);
|
||||||
|
|
||||||
|
gtk_widget_show (box);
|
||||||
|
|
||||||
return box;
|
return box;
|
||||||
}
|
}
|
||||||
@@ -125,7 +129,7 @@ do_gears (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -208,7 +208,7 @@ do_gestures (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -355,6 +355,7 @@ create_axis_slider (int axis)
|
|||||||
|
|
||||||
label = gtk_label_new (text);
|
label = gtk_label_new (text);
|
||||||
gtk_box_append (GTK_BOX (box), label);
|
gtk_box_append (GTK_BOX (box), label);
|
||||||
|
gtk_widget_show (label);
|
||||||
|
|
||||||
adj = gtk_adjustment_new (0.0, 0.0, 360.0, 1.0, 12.0, 0.0);
|
adj = gtk_adjustment_new (0.0, 0.0, 360.0, 1.0, 12.0, 0.0);
|
||||||
g_signal_connect (adj, "value-changed",
|
g_signal_connect (adj, "value-changed",
|
||||||
@@ -363,6 +364,9 @@ create_axis_slider (int axis)
|
|||||||
slider = gtk_scale_new (GTK_ORIENTATION_HORIZONTAL, adj);
|
slider = gtk_scale_new (GTK_ORIENTATION_HORIZONTAL, adj);
|
||||||
gtk_box_append (GTK_BOX (box), slider);
|
gtk_box_append (GTK_BOX (box), slider);
|
||||||
gtk_widget_set_hexpand (slider, TRUE);
|
gtk_widget_set_hexpand (slider, TRUE);
|
||||||
|
gtk_widget_show (slider);
|
||||||
|
|
||||||
|
gtk_widget_show (box);
|
||||||
|
|
||||||
return box;
|
return box;
|
||||||
}
|
}
|
||||||
@@ -436,7 +440,7 @@ do_glarea (GtkWidget *do_widget)
|
|||||||
demo_window = create_glarea_window (do_widget);
|
demo_window = create_glarea_window (do_widget);
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (demo_window))
|
if (!gtk_widget_get_visible (demo_window))
|
||||||
gtk_widget_set_visible (demo_window, TRUE);
|
gtk_widget_show (demo_window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (demo_window));
|
gtk_window_destroy (GTK_WINDOW (demo_window));
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ static void
|
|||||||
text_changed (GtkTextBuffer *buffer,
|
text_changed (GtkTextBuffer *buffer,
|
||||||
GtkWidget *button)
|
GtkWidget *button)
|
||||||
{
|
{
|
||||||
gtk_widget_set_visible (button, TRUE);
|
gtk_widget_show (button);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -58,7 +58,7 @@ apply_text (GtkWidget *button,
|
|||||||
g_object_unref (shader);
|
g_object_unref (shader);
|
||||||
g_bytes_unref (bytes);
|
g_bytes_unref (bytes);
|
||||||
|
|
||||||
gtk_widget_set_visible (button, FALSE);
|
gtk_widget_hide (button);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -237,7 +237,7 @@ make_shader_stack (const char *name,
|
|||||||
gtk_widget_set_halign (button, GTK_ALIGN_CENTER);
|
gtk_widget_set_halign (button, GTK_ALIGN_CENTER);
|
||||||
gtk_widget_set_valign (button, GTK_ALIGN_CENTER);
|
gtk_widget_set_valign (button, GTK_ALIGN_CENTER);
|
||||||
gtk_widget_add_css_class (button, "small");
|
gtk_widget_add_css_class (button, "small");
|
||||||
gtk_widget_set_visible (button, FALSE);
|
gtk_widget_hide (button);
|
||||||
gtk_center_box_set_end_widget (GTK_CENTER_BOX (widget), button);
|
gtk_center_box_set_end_widget (GTK_CENTER_BOX (widget), button);
|
||||||
|
|
||||||
gtk_box_append (GTK_BOX (vbox), widget);
|
gtk_box_append (GTK_BOX (vbox), widget);
|
||||||
@@ -354,7 +354,7 @@ do_gltransition (GtkWidget *do_widget)
|
|||||||
demo_window = create_gltransition_window (do_widget);
|
demo_window = create_gltransition_window (do_widget);
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (demo_window))
|
if (!gtk_widget_get_visible (demo_window))
|
||||||
gtk_widget_set_visible (demo_window, TRUE);
|
gtk_widget_show (demo_window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (demo_window));
|
gtk_window_destroy (GTK_WINDOW (demo_window));
|
||||||
|
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ do_headerbar (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -399,7 +399,7 @@ do_hypertext (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -378,7 +378,7 @@ do_iconscroll (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -320,7 +320,7 @@ do_iconview (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
/* Icon View/Editing and Drag-and-Drop
|
/* Icon View/Editing and Drag-and-Drop
|
||||||
* #Keywords: dnd
|
|
||||||
*
|
*
|
||||||
* The GtkIconView widget supports Editing and Drag-and-Drop.
|
* The GtkIconView widget supports Editing and Drag-and-Drop.
|
||||||
* This example also demonstrates using the generic GtkCellLayout
|
* This example also demonstrates using the generic GtkCellLayout
|
||||||
@@ -151,7 +150,7 @@ do_iconview_edit (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -83,17 +83,24 @@ progressive_timeout (gpointer data)
|
|||||||
|
|
||||||
if (bytes_read < 0)
|
if (bytes_read < 0)
|
||||||
{
|
{
|
||||||
GtkAlertDialog *dialog;
|
GtkWidget *dialog;
|
||||||
|
|
||||||
dialog = gtk_alert_dialog_new ("Failure reading image file 'alphatest.png': %s",
|
dialog = gtk_message_dialog_new (GTK_WINDOW (window),
|
||||||
error->message);
|
GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||||
gtk_alert_dialog_show (dialog, NULL);
|
GTK_MESSAGE_ERROR,
|
||||||
g_object_unref (dialog);
|
GTK_BUTTONS_CLOSE,
|
||||||
|
"Failure reading image file 'alphatest.png': %s",
|
||||||
|
error->message);
|
||||||
g_error_free (error);
|
g_error_free (error);
|
||||||
|
|
||||||
|
g_signal_connect (dialog, "response",
|
||||||
|
G_CALLBACK (gtk_window_destroy), NULL);
|
||||||
|
|
||||||
g_object_unref (image_stream);
|
g_object_unref (image_stream);
|
||||||
image_stream = NULL;
|
image_stream = NULL;
|
||||||
|
|
||||||
|
gtk_widget_show (dialog);
|
||||||
|
|
||||||
load_timeout = 0;
|
load_timeout = 0;
|
||||||
|
|
||||||
return FALSE; /* uninstall the timeout */
|
return FALSE; /* uninstall the timeout */
|
||||||
@@ -103,17 +110,25 @@ progressive_timeout (gpointer data)
|
|||||||
buf, bytes_read,
|
buf, bytes_read,
|
||||||
&error))
|
&error))
|
||||||
{
|
{
|
||||||
GtkAlertDialog *dialog;
|
GtkWidget *dialog;
|
||||||
|
|
||||||
|
dialog = gtk_message_dialog_new (GTK_WINDOW (window),
|
||||||
|
GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||||
|
GTK_MESSAGE_ERROR,
|
||||||
|
GTK_BUTTONS_CLOSE,
|
||||||
|
"Failed to load image: %s",
|
||||||
|
error->message);
|
||||||
|
|
||||||
dialog = gtk_alert_dialog_new ("Failed to load image: %s",
|
|
||||||
error->message);
|
|
||||||
gtk_alert_dialog_show (dialog, NULL);
|
|
||||||
g_object_unref (dialog);
|
|
||||||
g_error_free (error);
|
g_error_free (error);
|
||||||
|
|
||||||
|
g_signal_connect (dialog, "response",
|
||||||
|
G_CALLBACK (gtk_window_destroy), NULL);
|
||||||
|
|
||||||
g_object_unref (image_stream);
|
g_object_unref (image_stream);
|
||||||
image_stream = NULL;
|
image_stream = NULL;
|
||||||
|
|
||||||
|
gtk_widget_show (dialog);
|
||||||
|
|
||||||
load_timeout = 0;
|
load_timeout = 0;
|
||||||
|
|
||||||
return FALSE; /* uninstall the timeout */
|
return FALSE; /* uninstall the timeout */
|
||||||
@@ -128,14 +143,22 @@ progressive_timeout (gpointer data)
|
|||||||
error = NULL;
|
error = NULL;
|
||||||
if (!g_input_stream_close (image_stream, NULL, &error))
|
if (!g_input_stream_close (image_stream, NULL, &error))
|
||||||
{
|
{
|
||||||
GtkAlertDialog *dialog;
|
GtkWidget *dialog;
|
||||||
|
|
||||||
|
dialog = gtk_message_dialog_new (GTK_WINDOW (window),
|
||||||
|
GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||||
|
GTK_MESSAGE_ERROR,
|
||||||
|
GTK_BUTTONS_CLOSE,
|
||||||
|
"Failed to load image: %s",
|
||||||
|
error->message);
|
||||||
|
|
||||||
dialog = gtk_alert_dialog_new ("Failed to load image: %s",
|
|
||||||
error->message);
|
|
||||||
gtk_alert_dialog_show (dialog, NULL);
|
|
||||||
g_object_unref (dialog);
|
|
||||||
g_error_free (error);
|
g_error_free (error);
|
||||||
|
|
||||||
|
g_signal_connect (dialog, "response",
|
||||||
|
G_CALLBACK (gtk_window_destroy), NULL);
|
||||||
|
|
||||||
|
gtk_widget_show (dialog);
|
||||||
|
|
||||||
g_object_unref (image_stream);
|
g_object_unref (image_stream);
|
||||||
image_stream = NULL;
|
image_stream = NULL;
|
||||||
g_object_unref (pixbuf_loader);
|
g_object_unref (pixbuf_loader);
|
||||||
@@ -154,16 +177,25 @@ progressive_timeout (gpointer data)
|
|||||||
* it was incomplete.
|
* it was incomplete.
|
||||||
*/
|
*/
|
||||||
error = NULL;
|
error = NULL;
|
||||||
if (!gdk_pixbuf_loader_close (pixbuf_loader, &error))
|
if (!gdk_pixbuf_loader_close (pixbuf_loader,
|
||||||
|
&error))
|
||||||
{
|
{
|
||||||
GtkAlertDialog *dialog;
|
GtkWidget *dialog;
|
||||||
|
|
||||||
|
dialog = gtk_message_dialog_new (GTK_WINDOW (window),
|
||||||
|
GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||||
|
GTK_MESSAGE_ERROR,
|
||||||
|
GTK_BUTTONS_CLOSE,
|
||||||
|
"Failed to load image: %s",
|
||||||
|
error->message);
|
||||||
|
|
||||||
dialog = gtk_alert_dialog_new ("Failed to load image: %s",
|
|
||||||
error->message);
|
|
||||||
gtk_alert_dialog_show (dialog, NULL);
|
|
||||||
g_object_unref (dialog);
|
|
||||||
g_error_free (error);
|
g_error_free (error);
|
||||||
|
|
||||||
|
g_signal_connect (dialog, "response",
|
||||||
|
G_CALLBACK (gtk_window_destroy), NULL);
|
||||||
|
|
||||||
|
gtk_widget_show (dialog);
|
||||||
|
|
||||||
g_object_unref (pixbuf_loader);
|
g_object_unref (pixbuf_loader);
|
||||||
pixbuf_loader = NULL;
|
pixbuf_loader = NULL;
|
||||||
|
|
||||||
@@ -184,14 +216,20 @@ progressive_timeout (gpointer data)
|
|||||||
|
|
||||||
if (image_stream == NULL)
|
if (image_stream == NULL)
|
||||||
{
|
{
|
||||||
GtkAlertDialog *dialog;
|
GtkWidget *dialog;
|
||||||
|
|
||||||
dialog = gtk_alert_dialog_new ("%s",
|
dialog = gtk_message_dialog_new (GTK_WINDOW (window),
|
||||||
error->message);
|
GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||||
gtk_alert_dialog_show (dialog, NULL);
|
GTK_MESSAGE_ERROR,
|
||||||
g_object_unref (dialog);
|
GTK_BUTTONS_CLOSE,
|
||||||
|
"%s", error->message);
|
||||||
g_error_free (error);
|
g_error_free (error);
|
||||||
|
|
||||||
|
g_signal_connect (dialog, "response",
|
||||||
|
G_CALLBACK (gtk_window_destroy), NULL);
|
||||||
|
|
||||||
|
gtk_widget_show (dialog);
|
||||||
|
|
||||||
load_timeout = 0;
|
load_timeout = 0;
|
||||||
|
|
||||||
return FALSE; /* uninstall the timeout */
|
return FALSE; /* uninstall the timeout */
|
||||||
@@ -422,7 +460,7 @@ do_images (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -7,15 +7,13 @@
|
|||||||
#include <glib/gi18n.h>
|
#include <glib/gi18n.h>
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
on_bar_response (GtkInfoBar *info_bar,
|
on_bar_response (GtkInfoBar *info_bar,
|
||||||
int response_id,
|
int response_id,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
GtkAlertDialog *dialog;
|
GtkWidget *dialog;
|
||||||
char *detail;
|
GtkWidget *window;
|
||||||
|
|
||||||
if (response_id == GTK_RESPONSE_CLOSE)
|
if (response_id == GTK_RESPONSE_CLOSE)
|
||||||
{
|
{
|
||||||
@@ -23,12 +21,19 @@ on_bar_response (GtkInfoBar *info_bar,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
dialog = gtk_alert_dialog_new ("You clicked a button on an info bar");
|
window = GTK_WIDGET (gtk_widget_get_root (GTK_WIDGET (info_bar)));
|
||||||
detail = g_strdup_printf ("Your response has been %d", response_id);
|
dialog = gtk_message_dialog_new (GTK_WINDOW (window),
|
||||||
gtk_alert_dialog_set_detail (dialog, detail);
|
GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||||
g_free (detail);
|
GTK_MESSAGE_INFO,
|
||||||
gtk_alert_dialog_show (dialog, GTK_WINDOW (gtk_widget_get_root (GTK_WIDGET (info_bar))));
|
GTK_BUTTONS_OK,
|
||||||
g_object_unref (dialog);
|
"You clicked a button on an info bar");
|
||||||
|
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
|
||||||
|
"Your response has id %d", response_id);
|
||||||
|
|
||||||
|
g_signal_connect_swapped (dialog, "response",
|
||||||
|
G_CALLBACK (gtk_window_destroy), dialog);
|
||||||
|
|
||||||
|
gtk_widget_show (dialog);
|
||||||
}
|
}
|
||||||
|
|
||||||
GtkWidget *
|
GtkWidget *
|
||||||
@@ -140,7 +145,7 @@ do_infobar (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -311,12 +311,5 @@ get_language_name_for_tag (guint32 tag)
|
|||||||
lang = hb_ot_tag_to_language (tag);
|
lang = hb_ot_tag_to_language (tag);
|
||||||
s = hb_language_to_string (lang);
|
s = hb_language_to_string (lang);
|
||||||
|
|
||||||
if (strcmp (s, "und-fonipa") == 0)
|
|
||||||
return "International Phonetic Alphabet";
|
|
||||||
else if (strcmp (s, "und-fonnapa") == 0)
|
|
||||||
return "North-American Phonetic Alphabet";
|
|
||||||
else if (strcmp (s, "ro-md") == 0)
|
|
||||||
return "Moldavian";
|
|
||||||
|
|
||||||
return get_language_name (pango_language_from_string (s));
|
return get_language_name (pango_language_from_string (s));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ do_layoutmanager (GtkWidget *parent)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -190,7 +190,7 @@ do_layoutmanager2 (GtkWidget *parent)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -7,22 +7,38 @@
|
|||||||
|
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
|
static void
|
||||||
|
response_cb (GtkWidget *dialog,
|
||||||
|
int response_id,
|
||||||
|
gpointer data)
|
||||||
|
{
|
||||||
|
gtk_window_destroy (GTK_WINDOW (dialog));
|
||||||
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
activate_link (GtkWidget *label,
|
activate_link (GtkWidget *label,
|
||||||
const char *uri,
|
const char *uri,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
if (g_strcmp0 (uri, "keynav") == 0)
|
if (g_strcmp0 (uri, "keynav") == 0)
|
||||||
{
|
{
|
||||||
GtkAlertDialog *dialog;
|
GtkWidget *dialog;
|
||||||
|
GtkWidget *parent;
|
||||||
|
|
||||||
dialog = gtk_alert_dialog_new ("Keyboard navigation");
|
parent = GTK_WIDGET (gtk_widget_get_root (label));
|
||||||
gtk_alert_dialog_set_detail (dialog,
|
dialog = gtk_message_dialog_new_with_markup (GTK_WINDOW (parent),
|
||||||
"The term ‘keynav’ is a shorthand for "
|
GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||||
"keyboard navigation and refers to the process of using "
|
GTK_MESSAGE_INFO,
|
||||||
"a program (exclusively) via keyboard input.");
|
GTK_BUTTONS_OK,
|
||||||
gtk_alert_dialog_show (dialog, GTK_WINDOW (gtk_widget_get_root (label)));
|
"Keyboard navigation");
|
||||||
g_object_unref (dialog);
|
gtk_message_dialog_format_secondary_markup (GTK_MESSAGE_DIALOG (dialog),
|
||||||
|
"The term <i>keynav</i> is a shorthand for "
|
||||||
|
"keyboard navigation and refers to the process of using "
|
||||||
|
"a program (exclusively) via keyboard input.");
|
||||||
|
gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
|
||||||
|
|
||||||
|
gtk_window_present (GTK_WINDOW (dialog));
|
||||||
|
g_signal_connect (dialog, "response", G_CALLBACK (response_cb), NULL);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@@ -63,10 +79,11 @@ do_links (GtkWidget *do_widget)
|
|||||||
gtk_widget_set_margin_top (label, 20);
|
gtk_widget_set_margin_top (label, 20);
|
||||||
gtk_widget_set_margin_bottom (label, 20);
|
gtk_widget_set_margin_bottom (label, 20);
|
||||||
gtk_window_set_child (GTK_WINDOW (window), label);
|
gtk_window_set_child (GTK_WINDOW (window), label);
|
||||||
|
gtk_widget_show (label);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -300,7 +300,7 @@ do_list_store (GtkWidget *do_widget)
|
|||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
{
|
{
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
if (timeout == 0) {
|
if (timeout == 0) {
|
||||||
/* FIXME this should use the animation-duration instead */
|
/* FIXME this should use the animation-duration instead */
|
||||||
timeout = g_timeout_add (80, spinner_timeout, NULL);
|
timeout = g_timeout_add (80, spinner_timeout, NULL);
|
||||||
|
|||||||
@@ -380,6 +380,7 @@ do_listbox (GtkWidget *do_widget)
|
|||||||
{
|
{
|
||||||
message = gtk_message_new (lines[i]);
|
message = gtk_message_new (lines[i]);
|
||||||
row = gtk_message_row_new (message);
|
row = gtk_message_row_new (message);
|
||||||
|
gtk_widget_show (GTK_WIDGET (row));
|
||||||
gtk_list_box_insert (GTK_LIST_BOX (listbox), GTK_WIDGET (row), -1);
|
gtk_list_box_insert (GTK_LIST_BOX (listbox), GTK_WIDGET (row), -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -388,7 +389,7 @@ do_listbox (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ do_listbox_controls (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -117,16 +117,19 @@ activate_cb (GtkListView *list,
|
|||||||
G_APP_LAUNCH_CONTEXT (context),
|
G_APP_LAUNCH_CONTEXT (context),
|
||||||
&error))
|
&error))
|
||||||
{
|
{
|
||||||
GtkAlertDialog *dialog;
|
GtkWidget *dialog;
|
||||||
|
|
||||||
/* And because error handling is important, even a simple demo has it:
|
/* And because error handling is important, even a simple demo has it:
|
||||||
* We display an error dialog that something went wrong.
|
* We display an error dialog that something went wrong.
|
||||||
*/
|
*/
|
||||||
dialog = gtk_alert_dialog_new ("Could not launch %s", g_app_info_get_display_name (app_info));
|
dialog = gtk_message_dialog_new (GTK_WINDOW (gtk_widget_get_root (GTK_WIDGET (list))),
|
||||||
gtk_alert_dialog_set_detail (dialog, error->message);
|
GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_MODAL,
|
||||||
gtk_alert_dialog_show (dialog, GTK_WINDOW (gtk_widget_get_root (GTK_WIDGET (list))));
|
GTK_MESSAGE_ERROR,
|
||||||
g_object_unref (dialog);
|
GTK_BUTTONS_CLOSE,
|
||||||
|
"Could not launch %s", g_app_info_get_display_name (app_info));
|
||||||
|
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog), "%s", error->message);
|
||||||
g_clear_error (&error);
|
g_clear_error (&error);
|
||||||
|
gtk_widget_show (dialog);
|
||||||
}
|
}
|
||||||
|
|
||||||
g_object_unref (context);
|
g_object_unref (context);
|
||||||
@@ -191,7 +194,7 @@ do_listview_applauncher (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -494,7 +494,7 @@ do_listview_clocks (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -1124,7 +1124,7 @@ do_listview_colors (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -275,7 +275,7 @@ do_listview_filebrowser (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -485,7 +485,7 @@ do_listview_minesweeper (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -430,7 +430,7 @@ do_listview_settings (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -383,7 +383,7 @@ do_listview_ucd (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -317,7 +317,7 @@ do_listview_weather (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ update_title_cb (GtkFilterListModel *model)
|
|||||||
title = g_strdup_printf ("%u lines", g_list_model_get_n_items (G_LIST_MODEL (model)));
|
title = g_strdup_printf ("%u lines", g_list_model_get_n_items (G_LIST_MODEL (model)));
|
||||||
|
|
||||||
gtk_widget_set_visible (progress, pending != 0);
|
gtk_widget_set_visible (progress, pending != 0);
|
||||||
gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (progress), total > 0 ? (total - pending) / (double) total : 0.);
|
gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (progress), (total - pending) / (double) total);
|
||||||
gtk_window_set_title (GTK_WINDOW (window), title);
|
gtk_window_set_title (GTK_WINDOW (window), title);
|
||||||
g_free (title);
|
g_free (title);
|
||||||
}
|
}
|
||||||
@@ -141,34 +141,39 @@ load_file (GtkStringList *list,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
open_response_cb (GObject *source,
|
open_response_cb (GtkNativeDialog *dialog,
|
||||||
GAsyncResult *result,
|
int response,
|
||||||
void *user_data)
|
GtkStringList *stringlist)
|
||||||
{
|
{
|
||||||
GtkFileDialog *dialog = GTK_FILE_DIALOG (source);
|
gtk_native_dialog_hide (dialog);
|
||||||
GtkStringList *stringlist = GTK_STRING_LIST (user_data);
|
|
||||||
GFile *file;
|
|
||||||
|
|
||||||
file = gtk_file_dialog_open_finish (dialog, result, NULL);
|
if (response == GTK_RESPONSE_ACCEPT)
|
||||||
if (file)
|
|
||||||
{
|
{
|
||||||
|
GFile *file;
|
||||||
|
|
||||||
|
file = gtk_file_chooser_get_file (GTK_FILE_CHOOSER (dialog));
|
||||||
load_file (stringlist, file);
|
load_file (stringlist, file);
|
||||||
g_object_unref (file);
|
g_object_unref (file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gtk_native_dialog_destroy (dialog);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
file_open_cb (GtkWidget *button,
|
file_open_cb (GtkWidget *button,
|
||||||
GtkStringList *stringlist)
|
GtkStringList *stringlist)
|
||||||
{
|
{
|
||||||
GtkFileDialog *dialog;
|
GtkFileChooserNative *dialog;
|
||||||
|
|
||||||
dialog = gtk_file_dialog_new ();
|
dialog = gtk_file_chooser_native_new ("Open file",
|
||||||
gtk_file_dialog_open (dialog,
|
GTK_WINDOW (gtk_widget_get_root (button)),
|
||||||
GTK_WINDOW (gtk_widget_get_root (button)),
|
GTK_FILE_CHOOSER_ACTION_OPEN,
|
||||||
NULL,
|
"_Load",
|
||||||
open_response_cb, stringlist);
|
"_Cancel");
|
||||||
g_object_unref (dialog);
|
gtk_native_dialog_set_modal (GTK_NATIVE_DIALOG (dialog), TRUE);
|
||||||
|
|
||||||
|
g_signal_connect (dialog, "response", G_CALLBACK (open_response_cb), stringlist);
|
||||||
|
gtk_native_dialog_show (GTK_NATIVE_DIALOG (dialog));
|
||||||
}
|
}
|
||||||
|
|
||||||
GtkWidget *
|
GtkWidget *
|
||||||
@@ -248,7 +253,7 @@ do_listview_words (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -463,6 +463,7 @@ add_data_tab (const char *demoname)
|
|||||||
widget = display_nothing (resource_name);
|
widget = display_nothing (resource_name);
|
||||||
|
|
||||||
label = gtk_label_new (label_string ? label_string : resources[i]);
|
label = gtk_label_new (label_string ? label_string : resources[i]);
|
||||||
|
gtk_widget_show (label);
|
||||||
gtk_notebook_append_page (GTK_NOTEBOOK (notebook), widget, label);
|
gtk_notebook_append_page (GTK_NOTEBOOK (notebook), widget, label);
|
||||||
g_object_set (gtk_notebook_get_page (GTK_NOTEBOOK (notebook), widget),
|
g_object_set (gtk_notebook_get_page (GTK_NOTEBOOK (notebook), widget),
|
||||||
"tab-expand", FALSE,
|
"tab-expand", FALSE,
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ do_markup (GtkWidget *do_widget)
|
|||||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||||
|
|
||||||
stack = gtk_stack_new ();
|
stack = gtk_stack_new ();
|
||||||
|
gtk_widget_show (stack);
|
||||||
gtk_window_set_child (GTK_WINDOW (window), stack);
|
gtk_window_set_child (GTK_WINDOW (window), stack);
|
||||||
|
|
||||||
show_source = gtk_check_button_new_with_label ("Source");
|
show_source = gtk_check_button_new_with_label ("Source");
|
||||||
@@ -117,10 +118,12 @@ do_markup (GtkWidget *do_widget)
|
|||||||
gtk_text_buffer_end_irreversible_action (buffer);
|
gtk_text_buffer_end_irreversible_action (buffer);
|
||||||
|
|
||||||
g_bytes_unref (bytes);
|
g_bytes_unref (bytes);
|
||||||
|
|
||||||
|
gtk_widget_show (stack);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ do_menu (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -156,7 +156,7 @@ demos_h = custom_target('gtk4 demo header',
|
|||||||
objcopy_supports_add_symbol = false
|
objcopy_supports_add_symbol = false
|
||||||
objcopy = find_program('objcopy', required : false)
|
objcopy = find_program('objcopy', required : false)
|
||||||
if objcopy.found()
|
if objcopy.found()
|
||||||
objcopy_supports_add_symbol = run_command(objcopy, '--help', check: false).stdout().contains('--add-symbol')
|
objcopy_supports_add_symbol = run_command(objcopy, '--help').stdout().contains('--add-symbol')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ld = find_program('ld', required : false)
|
ld = find_program('ld', required : false)
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ do_overlay (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ do_overlay_decorative (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ do_pagesetup (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -7,8 +7,6 @@
|
|||||||
#include <glib/gi18n.h>
|
#include <glib/gi18n.h>
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
COLOR_SET,
|
COLOR_SET,
|
||||||
N_SIGNALS
|
N_SIGNALS
|
||||||
@@ -53,8 +51,8 @@ static const char *pad_colors[] = {
|
|||||||
static GType drawing_area_get_type (void);
|
static GType drawing_area_get_type (void);
|
||||||
G_DEFINE_TYPE (DrawingArea, drawing_area, GTK_TYPE_WIDGET)
|
G_DEFINE_TYPE (DrawingArea, drawing_area, GTK_TYPE_WIDGET)
|
||||||
|
|
||||||
static void drawing_area_set_color (DrawingArea *area,
|
static void drawing_area_set_color (DrawingArea *area,
|
||||||
const GdkRGBA *color);
|
GdkRGBA *color);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
drawing_area_ensure_surface (DrawingArea *area,
|
drawing_area_ensure_surface (DrawingArea *area,
|
||||||
@@ -352,8 +350,8 @@ drawing_area_new (void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
drawing_area_set_color (DrawingArea *area,
|
drawing_area_set_color (DrawingArea *area,
|
||||||
const GdkRGBA *color)
|
GdkRGBA *color)
|
||||||
{
|
{
|
||||||
if (gdk_rgba_equal (&area->draw_color, color))
|
if (gdk_rgba_equal (&area->draw_color, color))
|
||||||
return;
|
return;
|
||||||
@@ -363,22 +361,21 @@ drawing_area_set_color (DrawingArea *area,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
color_button_color_set (GtkColorDialogButton *button,
|
color_button_color_set (GtkColorButton *button,
|
||||||
GParamSpec *pspec,
|
DrawingArea *draw_area)
|
||||||
DrawingArea *draw_area)
|
|
||||||
{
|
{
|
||||||
const GdkRGBA *color;
|
GdkRGBA color;
|
||||||
|
|
||||||
color = gtk_color_dialog_button_get_rgba (button);
|
gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (button), &color);
|
||||||
drawing_area_set_color (draw_area, color);
|
drawing_area_set_color (draw_area, &color);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
drawing_area_color_set (DrawingArea *area,
|
drawing_area_color_set (DrawingArea *area,
|
||||||
GdkRGBA *color,
|
GdkRGBA *color,
|
||||||
GtkColorDialogButton *button)
|
GtkColorButton *button)
|
||||||
{
|
{
|
||||||
gtk_color_dialog_button_set_rgba (button, color);
|
gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (button), color);
|
||||||
}
|
}
|
||||||
|
|
||||||
GtkWidget *
|
GtkWidget *
|
||||||
@@ -397,13 +394,13 @@ do_paint (GtkWidget *toplevel)
|
|||||||
|
|
||||||
headerbar = gtk_header_bar_new ();
|
headerbar = gtk_header_bar_new ();
|
||||||
|
|
||||||
colorbutton = gtk_color_dialog_button_new (gtk_color_dialog_new ());
|
colorbutton = gtk_color_button_new ();
|
||||||
g_signal_connect (colorbutton, "notify::rgba",
|
g_signal_connect (colorbutton, "color-set",
|
||||||
G_CALLBACK (color_button_color_set), draw_area);
|
G_CALLBACK (color_button_color_set), draw_area);
|
||||||
g_signal_connect (draw_area, "color-set",
|
g_signal_connect (draw_area, "color-set",
|
||||||
G_CALLBACK (drawing_area_color_set), colorbutton);
|
G_CALLBACK (drawing_area_color_set), colorbutton);
|
||||||
gtk_color_dialog_button_set_rgba (GTK_COLOR_DIALOG_BUTTON (colorbutton),
|
gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (colorbutton),
|
||||||
&(GdkRGBA) { 0, 0, 0, 1 });
|
&(GdkRGBA) { 0, 0, 0, 1 });
|
||||||
|
|
||||||
gtk_header_bar_pack_end (GTK_HEADER_BAR (headerbar), colorbutton);
|
gtk_header_bar_pack_end (GTK_HEADER_BAR (headerbar), colorbutton);
|
||||||
gtk_window_set_titlebar (GTK_WINDOW (window), headerbar);
|
gtk_window_set_titlebar (GTK_WINDOW (window), headerbar);
|
||||||
@@ -412,7 +409,7 @@ do_paint (GtkWidget *toplevel)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -175,7 +175,7 @@ do_paintable (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -214,7 +214,7 @@ do_paintable_animated (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -177,7 +177,7 @@ do_paintable_emblem (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -307,7 +307,7 @@ do_paintable_mediastream (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -13,24 +13,25 @@
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
open_response_cb (GObject *source,
|
open_response_cb (GtkNativeDialog *dialog,
|
||||||
GAsyncResult *result,
|
int response,
|
||||||
void *data)
|
GtkPicture *picture)
|
||||||
{
|
{
|
||||||
GtkFileDialog *dialog = GTK_FILE_DIALOG (source);
|
gtk_native_dialog_hide (dialog);
|
||||||
GtkPicture *picture = data;
|
|
||||||
GFile *file;
|
|
||||||
|
|
||||||
file = gtk_file_dialog_open_finish (dialog, result, NULL);
|
if (response == GTK_RESPONSE_ACCEPT)
|
||||||
if (file)
|
|
||||||
{
|
{
|
||||||
|
GFile *file;
|
||||||
GdkPaintable *paintable;
|
GdkPaintable *paintable;
|
||||||
|
|
||||||
|
file = gtk_file_chooser_get_file (GTK_FILE_CHOOSER (dialog));
|
||||||
paintable = svg_paintable_new (file);
|
paintable = svg_paintable_new (file);
|
||||||
gtk_picture_set_paintable (GTK_PICTURE (picture), paintable);
|
gtk_picture_set_paintable (GTK_PICTURE (picture), paintable);
|
||||||
g_object_unref (paintable);
|
g_object_unref (paintable);
|
||||||
g_object_unref (file);
|
g_object_unref (file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gtk_native_dialog_destroy (dialog);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -38,24 +39,20 @@ show_file_open (GtkWidget *button,
|
|||||||
GtkPicture *picture)
|
GtkPicture *picture)
|
||||||
{
|
{
|
||||||
GtkFileFilter *filter;
|
GtkFileFilter *filter;
|
||||||
GtkFileDialog *dialog;
|
GtkFileChooserNative *dialog;
|
||||||
GListStore *filters;
|
|
||||||
|
|
||||||
dialog = gtk_file_dialog_new ();
|
dialog = gtk_file_chooser_native_new ("Open node file",
|
||||||
gtk_file_dialog_set_title (dialog, "Open node file");
|
GTK_WINDOW (gtk_widget_get_root (button)),
|
||||||
|
GTK_FILE_CHOOSER_ACTION_OPEN,
|
||||||
|
"_Load",
|
||||||
|
"_Cancel");
|
||||||
|
|
||||||
filter = gtk_file_filter_new ();
|
filter = gtk_file_filter_new ();
|
||||||
gtk_file_filter_add_mime_type (filter, "image/svg+xml");
|
gtk_file_filter_add_mime_type (filter, "image/svg+xml");
|
||||||
filters = g_list_store_new (GTK_TYPE_FILE_FILTER);
|
gtk_file_chooser_set_filter (GTK_FILE_CHOOSER (dialog), filter);
|
||||||
g_list_store_append (filters, filter);
|
gtk_native_dialog_set_modal (GTK_NATIVE_DIALOG (dialog), TRUE);
|
||||||
g_object_unref (filter);
|
g_signal_connect (dialog, "response", G_CALLBACK (open_response_cb), picture);
|
||||||
gtk_file_dialog_set_filters (dialog, G_LIST_MODEL (filters));
|
gtk_native_dialog_show (GTK_NATIVE_DIALOG (dialog));
|
||||||
g_object_unref (filters);
|
|
||||||
|
|
||||||
gtk_file_dialog_open (dialog,
|
|
||||||
GTK_WINDOW (gtk_widget_get_root (button)),
|
|
||||||
NULL,
|
|
||||||
open_response_cb, picture);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static GtkWidget *window;
|
static GtkWidget *window;
|
||||||
|
|||||||
@@ -200,7 +200,7 @@ do_paintable_symbolic (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ do_panes (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ do_password_entry (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/* Peg Solitaire
|
/* Peg Solitaire
|
||||||
* #Keywords: GtkGridView, game, drag-and-drop, dnd
|
* #Keywords: GtkGridView, game
|
||||||
*
|
*
|
||||||
* This demo demonstrates how to use drag-and-drop to implement peg solitaire.
|
* This demo demonstrates how to use drag-and-drop to implement peg solitaire.
|
||||||
*
|
*
|
||||||
@@ -487,7 +487,7 @@ do_peg_solitaire (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -1,147 +1,71 @@
|
|||||||
/* Pickers and Launchers
|
/* Pickers
|
||||||
* #Keywords: GtkColorDialog, GtkFontDialog, GtkFileDialog, GtkFileLauncher, GtkUriLauncher
|
* #Keywords: GtkColorChooser, GtkFontChooser, GtkApplicationChooser
|
||||||
*
|
*
|
||||||
* The dialogs are mainly intended for use in preference dialogs.
|
* These widgets are mainly intended for use in preference dialogs.
|
||||||
* They allow to select colors, fonts and applications.
|
* They allow to select colors, fonts and applications.
|
||||||
*
|
*
|
||||||
* The launchers let you open files or URIs in applications that
|
* This demo shows both the default appearance for these dialogs,
|
||||||
* can handle them.
|
* as well as some of the customizations that are possible.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
static GtkWidget *app_picker;
|
|
||||||
|
|
||||||
static void
|
|
||||||
file_opened (GObject *source,
|
|
||||||
GAsyncResult *result,
|
|
||||||
void *data)
|
|
||||||
{
|
|
||||||
GFile *file;
|
|
||||||
GError *error = NULL;
|
|
||||||
char *name;
|
|
||||||
|
|
||||||
file = gtk_file_dialog_open_finish (GTK_FILE_DIALOG (source), result, &error);
|
|
||||||
|
|
||||||
if (!file)
|
|
||||||
{
|
|
||||||
g_print ("%s\n", error->message);
|
|
||||||
g_error_free (error);
|
|
||||||
gtk_widget_set_sensitive (app_picker, FALSE);
|
|
||||||
g_object_set_data (G_OBJECT (app_picker), "file", NULL);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
name = g_file_get_basename (file);
|
|
||||||
gtk_label_set_label (GTK_LABEL (data), name);
|
|
||||||
g_free (name);
|
|
||||||
|
|
||||||
gtk_widget_set_sensitive (app_picker, TRUE);
|
|
||||||
g_object_set_data_full (G_OBJECT (app_picker), "file", g_object_ref (file), g_object_unref);
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
abort_mission (gpointer data)
|
filter_font_cb (const PangoFontFamily *family,
|
||||||
|
const PangoFontFace *face,
|
||||||
|
gpointer data)
|
||||||
{
|
{
|
||||||
GCancellable *cancellable = data;
|
const char *alias_families[] = {
|
||||||
|
"Cursive",
|
||||||
|
"Fantasy",
|
||||||
|
"Monospace",
|
||||||
|
"Sans",
|
||||||
|
"Serif",
|
||||||
|
"System-ui",
|
||||||
|
NULL
|
||||||
|
};
|
||||||
|
const char *family_name;
|
||||||
|
|
||||||
g_cancellable_cancel (cancellable);
|
family_name = pango_font_family_get_name (PANGO_FONT_FAMILY (family));
|
||||||
|
|
||||||
return G_SOURCE_REMOVE;
|
return g_strv_contains (alias_families, family_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
#define COLOR(r,g,b) { r/255., g/255., b/255., 1.0 }
|
||||||
open_file (GtkButton *picker,
|
|
||||||
GtkLabel *label)
|
|
||||||
{
|
|
||||||
GtkWindow *parent = GTK_WINDOW (gtk_widget_get_root (GTK_WIDGET (picker)));
|
|
||||||
GtkFileDialog *dialog;
|
|
||||||
GCancellable *cancellable;
|
|
||||||
|
|
||||||
dialog = gtk_file_dialog_new ();
|
|
||||||
|
|
||||||
cancellable = g_cancellable_new ();
|
|
||||||
|
|
||||||
g_timeout_add_seconds_full (G_PRIORITY_DEFAULT,
|
|
||||||
20,
|
|
||||||
abort_mission, g_object_ref (cancellable), g_object_unref);
|
|
||||||
|
|
||||||
gtk_file_dialog_open (dialog, parent, cancellable, file_opened, label);
|
|
||||||
|
|
||||||
g_object_unref (cancellable);
|
|
||||||
g_object_unref (dialog);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
open_app_done (GObject *source,
|
|
||||||
GAsyncResult *result,
|
|
||||||
gpointer data)
|
|
||||||
{
|
|
||||||
GtkFileLauncher *launcher = GTK_FILE_LAUNCHER (source);
|
|
||||||
GError *error = NULL;
|
|
||||||
|
|
||||||
if (!gtk_file_launcher_launch_finish (launcher, result, &error))
|
|
||||||
{
|
|
||||||
g_print ("%s\n", error->message);
|
|
||||||
g_error_free (error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
open_app (GtkButton *picker)
|
|
||||||
{
|
|
||||||
GtkWindow *parent = GTK_WINDOW (gtk_widget_get_root (GTK_WIDGET (picker)));
|
|
||||||
GtkFileLauncher *launcher;
|
|
||||||
GFile *file;
|
|
||||||
|
|
||||||
file = G_FILE (g_object_get_data (G_OBJECT (picker), "file"));
|
|
||||||
launcher = gtk_file_launcher_new (file);
|
|
||||||
|
|
||||||
gtk_file_launcher_launch (launcher, parent, NULL, open_app_done, NULL);
|
|
||||||
|
|
||||||
g_object_unref (launcher);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
open_uri_done (GObject *source,
|
|
||||||
GAsyncResult *result,
|
|
||||||
gpointer data)
|
|
||||||
{
|
|
||||||
GtkUriLauncher *launcher = GTK_URI_LAUNCHER (source);
|
|
||||||
GError *error = NULL;
|
|
||||||
|
|
||||||
if (!gtk_uri_launcher_launch_finish (launcher, result, &error))
|
|
||||||
{
|
|
||||||
g_print ("%s\n", error->message);
|
|
||||||
g_error_free (error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
launch_uri (GtkButton *picker)
|
|
||||||
{
|
|
||||||
GtkWindow *parent = GTK_WINDOW (gtk_widget_get_root (GTK_WIDGET (picker)));
|
|
||||||
GtkUriLauncher *launcher;
|
|
||||||
|
|
||||||
launcher = gtk_uri_launcher_new ("http://www.gtk.org");
|
|
||||||
|
|
||||||
gtk_uri_launcher_launch (launcher, parent, NULL, open_uri_done, NULL);
|
|
||||||
|
|
||||||
g_object_unref (launcher);
|
|
||||||
}
|
|
||||||
|
|
||||||
GtkWidget *
|
GtkWidget *
|
||||||
do_pickers (GtkWidget *do_widget)
|
do_pickers (GtkWidget *do_widget)
|
||||||
{
|
{
|
||||||
static GtkWidget *window = NULL;
|
static GtkWidget *window = NULL;
|
||||||
GtkWidget *table, *label, *picker, *button;
|
GtkWidget *table, *label, *picker;
|
||||||
|
GdkRGBA solarized[] = {
|
||||||
|
COLOR (0xff, 0xff, 0xff),
|
||||||
|
COLOR (0x07, 0x36, 0x42),
|
||||||
|
COLOR (0xdc, 0x32, 0x2f),
|
||||||
|
COLOR (0x85, 0x99, 0x00),
|
||||||
|
COLOR (0xb5, 0x89, 0x00),
|
||||||
|
COLOR (0x26, 0x8b, 0xd2),
|
||||||
|
COLOR (0xd3, 0x36, 0x82),
|
||||||
|
COLOR (0x2a, 0xa1, 0x98),
|
||||||
|
COLOR (0xee, 0xe8, 0xd5),
|
||||||
|
|
||||||
|
COLOR (0x00, 0x00, 0x00),
|
||||||
|
COLOR (0x00, 0x2b, 0x36),
|
||||||
|
COLOR (0xcb, 0x4b, 0x16),
|
||||||
|
COLOR (0x58, 0x6e, 0x75),
|
||||||
|
COLOR (0x65, 0x7b, 0x83),
|
||||||
|
COLOR (0x83, 0x94, 0x96),
|
||||||
|
COLOR (0x6c, 0x71, 0xc4),
|
||||||
|
COLOR (0x93, 0xa1, 0xa1),
|
||||||
|
COLOR (0xfd, 0xf6, 0xe3),
|
||||||
|
};
|
||||||
|
|
||||||
if (!window)
|
if (!window)
|
||||||
{
|
{
|
||||||
window = gtk_window_new ();
|
window = gtk_window_new ();
|
||||||
gtk_window_set_display (GTK_WINDOW (window),
|
gtk_window_set_display (GTK_WINDOW (window),
|
||||||
gtk_widget_get_display (do_widget));
|
gtk_widget_get_display (do_widget));
|
||||||
gtk_window_set_title (GTK_WINDOW (window), "Pickers and Launchers");
|
gtk_window_set_title (GTK_WINDOW (window), "Pickers");
|
||||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||||
|
|
||||||
table = gtk_grid_new ();
|
table = gtk_grid_new ();
|
||||||
@@ -149,64 +73,70 @@ do_pickers (GtkWidget *do_widget)
|
|||||||
gtk_widget_set_margin_end (table, 20);
|
gtk_widget_set_margin_end (table, 20);
|
||||||
gtk_widget_set_margin_top (table, 20);
|
gtk_widget_set_margin_top (table, 20);
|
||||||
gtk_widget_set_margin_bottom (table, 20);
|
gtk_widget_set_margin_bottom (table, 20);
|
||||||
gtk_grid_set_row_spacing (GTK_GRID (table), 6);
|
gtk_grid_set_row_spacing (GTK_GRID (table), 3);
|
||||||
gtk_grid_set_column_spacing (GTK_GRID (table), 6);
|
gtk_grid_set_column_spacing (GTK_GRID (table), 10);
|
||||||
gtk_window_set_child (GTK_WINDOW (window), table);
|
gtk_window_set_child (GTK_WINDOW (window), table);
|
||||||
|
|
||||||
|
label = gtk_label_new ("Standard");
|
||||||
|
gtk_widget_add_css_class (label, "title-4");
|
||||||
|
gtk_grid_attach (GTK_GRID (table), label, 1, -1, 1, 1);
|
||||||
|
label = gtk_label_new ("Custom");
|
||||||
|
gtk_widget_add_css_class (label, "title-4");
|
||||||
|
gtk_grid_attach (GTK_GRID (table), label, 2, -1, 1, 1);
|
||||||
|
|
||||||
label = gtk_label_new ("Color:");
|
label = gtk_label_new ("Color:");
|
||||||
gtk_widget_set_halign (label, GTK_ALIGN_START);
|
gtk_widget_set_halign (label, GTK_ALIGN_START);
|
||||||
gtk_widget_set_valign (label, GTK_ALIGN_CENTER);
|
gtk_widget_set_valign (label, GTK_ALIGN_CENTER);
|
||||||
gtk_widget_set_hexpand (label, TRUE);
|
gtk_widget_set_hexpand (label, TRUE);
|
||||||
gtk_grid_attach (GTK_GRID (table), label, 0, 0, 1, 1);
|
gtk_grid_attach (GTK_GRID (table), label, 0, 0, 1, 1);
|
||||||
|
|
||||||
picker = gtk_color_dialog_button_new (gtk_color_dialog_new ());
|
picker = gtk_color_button_new ();
|
||||||
gtk_grid_attach (GTK_GRID (table), picker, 1, 0, 1, 1);
|
gtk_grid_attach (GTK_GRID (table), picker, 1, 0, 1, 1);
|
||||||
|
|
||||||
|
picker = gtk_color_button_new ();
|
||||||
|
gtk_color_button_set_title (GTK_COLOR_BUTTON (picker), "Solarized colors");
|
||||||
|
gtk_color_chooser_add_palette (GTK_COLOR_CHOOSER (picker),
|
||||||
|
GTK_ORIENTATION_HORIZONTAL,
|
||||||
|
9,
|
||||||
|
18,
|
||||||
|
solarized);
|
||||||
|
gtk_grid_attach (GTK_GRID (table), picker, 2, 0, 1, 1);
|
||||||
|
|
||||||
label = gtk_label_new ("Font:");
|
label = gtk_label_new ("Font:");
|
||||||
gtk_widget_set_halign (label, GTK_ALIGN_START);
|
gtk_widget_set_halign (label, GTK_ALIGN_START);
|
||||||
gtk_widget_set_valign (label, GTK_ALIGN_CENTER);
|
gtk_widget_set_valign (label, GTK_ALIGN_CENTER);
|
||||||
gtk_widget_set_hexpand (label, TRUE);
|
gtk_widget_set_hexpand (label, TRUE);
|
||||||
gtk_grid_attach (GTK_GRID (table), label, 0, 1, 1, 1);
|
gtk_grid_attach (GTK_GRID (table), label, 0, 1, 1, 1);
|
||||||
|
|
||||||
picker = gtk_font_dialog_button_new (gtk_font_dialog_new ());
|
picker = gtk_font_button_new ();
|
||||||
gtk_grid_attach (GTK_GRID (table), picker, 1, 1, 1, 1);
|
gtk_grid_attach (GTK_GRID (table), picker, 1, 1, 1, 1);
|
||||||
|
|
||||||
label = gtk_label_new ("File:");
|
picker = gtk_font_button_new ();
|
||||||
|
gtk_font_chooser_set_level (GTK_FONT_CHOOSER (picker),
|
||||||
|
GTK_FONT_CHOOSER_LEVEL_FAMILY |
|
||||||
|
GTK_FONT_CHOOSER_LEVEL_SIZE);
|
||||||
|
gtk_font_chooser_set_filter_func (GTK_FONT_CHOOSER (picker), filter_font_cb, NULL, NULL);
|
||||||
|
|
||||||
|
gtk_grid_attach (GTK_GRID (table), picker, 2, 1, 1, 1);
|
||||||
|
|
||||||
|
label = gtk_label_new ("Mail:");
|
||||||
gtk_widget_set_halign (label, GTK_ALIGN_START);
|
gtk_widget_set_halign (label, GTK_ALIGN_START);
|
||||||
gtk_widget_set_valign (label, GTK_ALIGN_CENTER);
|
gtk_widget_set_valign (label, GTK_ALIGN_CENTER);
|
||||||
gtk_widget_set_hexpand (label, TRUE);
|
gtk_widget_set_hexpand (label, TRUE);
|
||||||
gtk_grid_attach (GTK_GRID (table), label, 0, 2, 1, 1);
|
|
||||||
|
|
||||||
picker = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
|
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||||
button = gtk_button_new_from_icon_name ("document-open-symbolic");
|
|
||||||
label = gtk_label_new ("None");
|
|
||||||
gtk_label_set_xalign (GTK_LABEL (label), 0.);
|
|
||||||
gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_MIDDLE);
|
|
||||||
gtk_widget_set_hexpand (label, TRUE);
|
|
||||||
g_signal_connect (button, "clicked", G_CALLBACK (open_file), label);
|
|
||||||
gtk_box_append (GTK_BOX (picker), label);
|
|
||||||
gtk_box_append (GTK_BOX (picker), button);
|
|
||||||
app_picker = gtk_button_new_from_icon_name ("emblem-system-symbolic");
|
|
||||||
gtk_widget_set_halign (app_picker, GTK_ALIGN_END);
|
|
||||||
gtk_widget_set_sensitive (app_picker, FALSE);
|
|
||||||
g_signal_connect (app_picker, "clicked", G_CALLBACK (open_app), NULL);
|
|
||||||
gtk_box_append (GTK_BOX (picker), app_picker);
|
|
||||||
gtk_grid_attach (GTK_GRID (table), picker, 1, 2, 1, 1);
|
|
||||||
|
|
||||||
|
picker = gtk_app_chooser_button_new ("x-scheme-handler/mailto");
|
||||||
|
gtk_app_chooser_button_set_show_dialog_item (GTK_APP_CHOOSER_BUTTON (picker), TRUE);
|
||||||
|
|
||||||
|
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||||
|
|
||||||
label = gtk_label_new ("URI:");
|
|
||||||
gtk_widget_set_halign (label, GTK_ALIGN_START);
|
|
||||||
gtk_widget_set_valign (label, GTK_ALIGN_CENTER);
|
|
||||||
gtk_widget_set_hexpand (label, TRUE);
|
|
||||||
gtk_grid_attach (GTK_GRID (table), label, 0, 3, 1, 1);
|
gtk_grid_attach (GTK_GRID (table), label, 0, 3, 1, 1);
|
||||||
|
|
||||||
picker = gtk_button_new_with_label ("www.gtk.org");
|
|
||||||
g_signal_connect (picker, "clicked", G_CALLBACK (launch_uri), NULL);
|
|
||||||
gtk_grid_attach (GTK_GRID (table), picker, 1, 3, 1, 1);
|
gtk_grid_attach (GTK_GRID (table), picker, 1, 3, 1, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -177,12 +177,19 @@ do_printing (GtkWidget *do_widget)
|
|||||||
|
|
||||||
if (error)
|
if (error)
|
||||||
{
|
{
|
||||||
GtkAlertDialog *dialog;
|
GtkWidget *dialog;
|
||||||
|
|
||||||
dialog = gtk_alert_dialog_new ("%s", error->message);
|
dialog = gtk_message_dialog_new (GTK_WINDOW (do_widget),
|
||||||
gtk_alert_dialog_show (dialog, GTK_WINDOW (do_widget));
|
GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||||
g_object_unref (dialog);
|
GTK_MESSAGE_ERROR,
|
||||||
|
GTK_BUTTONS_CLOSE,
|
||||||
|
"%s", error->message);
|
||||||
g_error_free (error);
|
g_error_free (error);
|
||||||
|
|
||||||
|
g_signal_connect (dialog, "response",
|
||||||
|
G_CALLBACK (gtk_window_destroy), NULL);
|
||||||
|
|
||||||
|
gtk_widget_show (dialog);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -231,7 +231,7 @@ do_read_more (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ do_revealer (GtkWidget *do_widget)
|
|||||||
{
|
{
|
||||||
count = 0;
|
count = 0;
|
||||||
timeout = g_timeout_add (690, reveal_one, window);
|
timeout = g_timeout_add (690, reveal_one, window);
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -210,7 +210,7 @@ do_rotated_text (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ do_scale (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -294,11 +294,13 @@ do_search_entry (GtkWidget *do_widget)
|
|||||||
g_signal_connect (find_button, "clicked",
|
g_signal_connect (find_button, "clicked",
|
||||||
G_CALLBACK (start_search), entry);
|
G_CALLBACK (start_search), entry);
|
||||||
gtk_notebook_append_page (GTK_NOTEBOOK (notebook), find_button, NULL);
|
gtk_notebook_append_page (GTK_NOTEBOOK (notebook), find_button, NULL);
|
||||||
|
gtk_widget_show (find_button);
|
||||||
|
|
||||||
cancel_button = gtk_button_new_with_label ("Cancel");
|
cancel_button = gtk_button_new_with_label ("Cancel");
|
||||||
g_signal_connect (cancel_button, "clicked",
|
g_signal_connect (cancel_button, "clicked",
|
||||||
G_CALLBACK (stop_search), NULL);
|
G_CALLBACK (stop_search), NULL);
|
||||||
gtk_notebook_append_page (GTK_NOTEBOOK (notebook), cancel_button, NULL);
|
gtk_notebook_append_page (GTK_NOTEBOOK (notebook), cancel_button, NULL);
|
||||||
|
gtk_widget_show (cancel_button);
|
||||||
|
|
||||||
/* Set up the search icon */
|
/* Set up the search icon */
|
||||||
gtk_entry_set_icon_activatable (GTK_ENTRY (entry), GTK_ENTRY_ICON_PRIMARY, TRUE);
|
gtk_entry_set_icon_activatable (GTK_ENTRY (entry), GTK_ENTRY_ICON_PRIMARY, TRUE);
|
||||||
@@ -312,7 +314,7 @@ do_search_entry (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
g_clear_object (&actions);
|
g_clear_object (&actions);
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ do_search_entry2 (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -194,7 +194,7 @@ do_shadertoy (GtkWidget *do_widget)
|
|||||||
demo_window = create_shadertoy_window (do_widget);
|
demo_window = create_shadertoy_window (do_widget);
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (demo_window))
|
if (!gtk_widget_get_visible (demo_window))
|
||||||
gtk_widget_set_visible (demo_window, TRUE);
|
gtk_widget_show (demo_window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (demo_window));
|
gtk_window_destroy (GTK_WINDOW (demo_window));
|
||||||
|
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ do_shortcut_triggers (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ show_shortcuts (GtkWidget *window,
|
|||||||
overlay = GTK_WIDGET (gtk_builder_get_object (builder, id));
|
overlay = GTK_WIDGET (gtk_builder_get_object (builder, id));
|
||||||
gtk_window_set_transient_for (GTK_WINDOW (overlay), GTK_WINDOW (window));
|
gtk_window_set_transient_for (GTK_WINDOW (overlay), GTK_WINDOW (window));
|
||||||
g_object_set (overlay, "view-name", view, NULL);
|
g_object_set (overlay, "view-name", view, NULL);
|
||||||
|
gtk_widget_show (overlay);
|
||||||
g_object_unref (builder);
|
g_object_unref (builder);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -94,7 +95,7 @@ do_shortcuts (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ do_sidebar (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ do_sizegroup (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -515,7 +515,7 @@ do_sliding_puzzle (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
@@ -236,7 +236,7 @@ do_spinbutton (GtkWidget *do_widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
gtk_widget_set_visible (window, TRUE);
|
gtk_widget_show (window);
|
||||||
else
|
else
|
||||||
gtk_window_destroy (GTK_WINDOW (window));
|
gtk_window_destroy (GTK_WINDOW (window));
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user