Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b35e20b43b | |||
| 827bd96820 |
@@ -1,56 +1,3 @@
|
||||
Overview of Changes in GTK+ 3.24.6
|
||||
==================================
|
||||
|
||||
* Link against fribidi
|
||||
|
||||
* Broadway: Ensure focus on click
|
||||
|
||||
* Fix some compiler warnings
|
||||
|
||||
* Improve menu positioning with move-to-rect
|
||||
|
||||
* Improve activation of the onscreen keyboard
|
||||
|
||||
* Use C locale when generating code
|
||||
|
||||
* Treeview: Make sure separator nodes have height > 0
|
||||
|
||||
* theme
|
||||
- Fix some inconsistences for radii
|
||||
|
||||
* quartz:
|
||||
- Full-screen only normal windows
|
||||
- Restore key-window switching when changing windows
|
||||
- Change monitor geometry calculation
|
||||
- search: Limit the cop of Spotlight search
|
||||
|
||||
* Translation updates:
|
||||
Basque
|
||||
Dutch
|
||||
Finnish
|
||||
Icelandic
|
||||
Kazakh
|
||||
Korean
|
||||
Romanian
|
||||
Serbian
|
||||
Slovenian
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.24.5
|
||||
==================================
|
||||
|
||||
* Adwaita: Refresh the theme
|
||||
|
||||
* HighContrast: Refresh the theme
|
||||
|
||||
* Wayland: Implement gdk_window_present
|
||||
|
||||
* GtkSwitch: Use icons instead of glyphs
|
||||
|
||||
* Translation updates:
|
||||
Hungarian
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.24.4
|
||||
==================================
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<GdkDefines>GDK_COMPILATION;G_LOG_DOMAIN="Gdk"</GdkDefines>
|
||||
<GtkIncludedImmodulesDefines>INCLUDE_IM_am_et;INCLUDE_IM_cedilla;INCLUDE_IM_cyrillic_translit;INCLUDE_IM_ime;INCLUDE_IM_inuktitut;INCLUDE_IM_ipa;INCLUDE_IM_multipress;INCLUDE_IM_thai;INCLUDE_IM_ti_er;INCLUDE_IM_ti_et;INCLUDE_IM_viqr</GtkIncludedImmodulesDefines>
|
||||
<GtkDefines>GTK_COMPILATION;G_LOG_DOMAIN="Gtk";GTK_HOST="i686-pc-vs$(VSVer)";GTK_PRINT_BACKENDS="file";GTK_PRINT_BACKEND_ENABLE_UNSUPPORTED;$(GtkIncludedImmodulesDefines);GTK_LIBDIR="$(GtkDummyPrefix)/lib";GTK_DATADIR="$(GtkDummyPrefix)/share";GTK_DATA_PREFIX="$(GtkDummyPrefix)";GTK_SYSCONFDIR="$(GtkDummyPrefix)/etc";MULTIPRESS_CONFDIR="$(GtkDummyPrefix)/etc/gtk-$(ApiVersion)";MULTIPRESS_LOCALEDIR="$(GtkDummyPrefix)/share/locale";GTK_VERSION="$(GtkVersion)/etc";GTK_BINARY_VERSION="$(GtkBinaryVersion)/etc";GDK_DISABLE_DEPRECATED;ISOLATION_AWARE_ENABLED</GtkDefines>
|
||||
<GtkGdkCommonLibs>pangowin32-1.0.lib;fribidi.lib;imm32.lib</GtkGdkCommonLibs>
|
||||
<GtkGdkCommonLibs>pangowin32-1.0.lib;imm32.lib</GtkGdkCommonLibs>
|
||||
<GdkAdditionalLibs>winmm.lib;dwmapi.lib;setupapi.lib;$(GtkGdkCommonLibs)</GdkAdditionalLibs>
|
||||
<GdkBroadwayAdditionalLibs>ws2_32.lib</GdkBroadwayAdditionalLibs>
|
||||
<GtkAdditionalLibs>atk-1.0.lib;winspool.lib;comctl32.lib;$(GtkGdkCommonLibs)</GtkAdditionalLibs>
|
||||
@@ -26,7 +26,7 @@ nmake -f gtk-introspection-msvc.mak CFG=$(Configuration) PREFIX=$(GlibEtcInstall
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>..\..\..;$(GlibEtcInstallRoot)\include\gdk-pixbuf-2.0;$(GlibEtcInstallRoot)\include\pango-1.0;$(GlibEtcInstallRoot)\include\atk-1.0;$(GlibEtcInstallRoot)\include\cairo;$(GlibEtcInstallRoot)\include\gio-win32-2.0;$(GlibEtcInstallRoot)\include\glib-2.0;$(GlibEtcInstallRoot)\lib\glib-2.0\include;$(GlibEtcInstallRoot)\include\fribidi;$(GlibEtcInstallRoot)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>..\..\..;$(GlibEtcInstallRoot)\include\gdk-pixbuf-2.0;$(GlibEtcInstallRoot)\include\pango-1.0;$(GlibEtcInstallRoot)\include\atk-1.0;$(GlibEtcInstallRoot)\include\cairo;$(GlibEtcInstallRoot)\include\gio-win32-2.0;$(GlibEtcInstallRoot)\include\glib-2.0;$(GlibEtcInstallRoot)\lib\glib-2.0\include;$(GlibEtcInstallRoot)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>HAVE_CONFIG_H;G_DISABLE_SINGLE_INCLUDES;ATK_DISABLE_SINGLE_INCLUDES;GDK_PIXBUF_DISABLE_SINGLE_INCLUDES;GTK_DISABLE_SINGLE_INCLUDES;_USE_MATH_DEFINES;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ForcedIncludeFiles>msvc_recommended_pragmas.h;%(ForcedIncludeFiles)</ForcedIncludeFiles>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories="..\..\..;$(GlibEtcInstallRoot)\include\gdk-pixbuf-2.0;$(GlibEtcInstallRoot)\include\pango-1.0;$(GlibEtcInstallRoot)\include\atk-1.0;$(GlibEtcInstallRoot)\include\cairo;$(GlibEtcInstallRoot)\include\gio-win32-2.0;$(GlibEtcInstallRoot)\include\glib-2.0;$(GlibEtcInstallRoot)\lib\glib-2.0\include;$(GlibEtcInstallRoot)\include\fribidi;$(GlibEtcInstallRoot)\include"
|
||||
AdditionalIncludeDirectories="..\..\..;$(GlibEtcInstallRoot)\include\gdk-pixbuf-2.0;$(GlibEtcInstallRoot)\include\pango-1.0;$(GlibEtcInstallRoot)\include\atk-1.0;$(GlibEtcInstallRoot)\include\cairo;$(GlibEtcInstallRoot)\include\gio-win32-2.0;$(GlibEtcInstallRoot)\include\glib-2.0;$(GlibEtcInstallRoot)\lib\glib-2.0\include;$(GlibEtcInstallRoot)\include"
|
||||
PreprocessorDefinitions="HAVE_CONFIG_H;G_DISABLE_SINGLE_INCLUDES;ATK_DISABLE_SINGLE_INCLUDES;GDK_PIXBUF_DISABLE_SINGLE_INCLUDES;GTK_DISABLE_SINGLE_INCLUDES;_USE_MATH_DEFINES"
|
||||
ForcedIncludeFiles="msvc_recommended_pragmas.h"
|
||||
AdditionalOptions="/MP"
|
||||
@@ -45,7 +45,7 @@
|
||||
/>
|
||||
<UserMacro
|
||||
Name="GtkGdkCommonLibs"
|
||||
Value="pangowin32-1.0.lib fribidi.lib imm32.lib"
|
||||
Value="pangowin32-1.0.lib imm32.lib"
|
||||
/>
|
||||
<UserMacro
|
||||
Name="GdkBroadwayAdditionalLibs"
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
|
||||
m4_define([gtk_major_version], [3])
|
||||
m4_define([gtk_minor_version], [24])
|
||||
m4_define([gtk_micro_version], [6])
|
||||
m4_define([gtk_interface_age], [2])
|
||||
m4_define([gtk_micro_version], [4])
|
||||
m4_define([gtk_interface_age], [0])
|
||||
m4_define([gtk_binary_age],
|
||||
[m4_eval(100 * gtk_minor_version + gtk_micro_version)])
|
||||
m4_define([gtk_version],
|
||||
@@ -55,7 +55,6 @@ m4_define([glib_max_allowed_version], m4_join([_], [GLIB_VERSION], glib_required
|
||||
GLIB_VERSION_CFLAGS="-DGLIB_MIN_REQUIRED_VERSION=glib_min_required_version -DGLIB_MAX_ALLOWED_VERSION=glib_max_allowed_version"
|
||||
|
||||
m4_define([pango_required_version], [1.41.0])
|
||||
m4_define([fribidi_required_version], [0.19.7])
|
||||
m4_define([atk_required_version], [2.15.1])
|
||||
m4_define([cairo_required_version], [1.14.0])
|
||||
m4_define([gdk_pixbuf_required_version], [2.30.0])
|
||||
@@ -586,7 +585,6 @@ PKG_CHECK_MODULES(BASE_DEPENDENCIES,
|
||||
[glib-2.0 >= glib_required_version dnl
|
||||
atk >= atk_required_version dnl
|
||||
pango >= pango_required_version dnl
|
||||
fribidi >= fribidi_required_version dnl
|
||||
cairo >= cairo_required_version dnl
|
||||
cairo-gobject >= cairo_required_version dnl
|
||||
gdk-pixbuf-2.0 >= gdk_pixbuf_required_version])
|
||||
@@ -1377,7 +1375,7 @@ CFLAGS="$saved_cflags"
|
||||
LDFLAGS="$saved_ldflags"
|
||||
|
||||
GDK_PACKAGES="$PANGO_PACKAGES gdk-pixbuf-2.0 >= gdk_pixbuf_required_version cairo >= cairo_required_version cairo-gobject >= cairo_required_version"
|
||||
GDK_PRIVATE_PACKAGES="$GDK_GIO_PACKAGE $X_PACKAGES $WAYLAND_PACKAGES $MIR_PACKAGES $cairo_backends epoxy >= epoxy_required_version $CLOUDPROVIDER_PACKAGES fribidi >= fribidi_required_version"
|
||||
GDK_PRIVATE_PACKAGES="$GDK_GIO_PACKAGE $X_PACKAGES $WAYLAND_PACKAGES $MIR_PACKAGES $cairo_backends epoxy >= epoxy_required_version $CLOUDPROVIDER_PACKAGES"
|
||||
|
||||
PKG_CHECK_MODULES(GDK_DEP, $GDK_PACKAGES $GDK_PRIVATE_PACKAGES)
|
||||
GDK_DEP_LIBS="$GDK_EXTRA_LIBS $GDK_DEP_LIBS $MATH_LIB"
|
||||
@@ -1411,7 +1409,7 @@ fi
|
||||
PKG_CHECK_MODULES(ATK, $ATK_PACKAGES)
|
||||
|
||||
GTK_PACKAGES="atk >= atk_required_version cairo >= cairo_required_version cairo-gobject >= cairo_required_version gdk-pixbuf-2.0 >= gdk_pixbuf_required_version gio-2.0 >= glib_required_version"
|
||||
GTK_PRIVATE_PACKAGES="$ATK_PACKAGES $WAYLAND_PACKAGES $MIR_PACKAGES epoxy >= epoxy_required_version fribidi >= fribidi_required_dep"
|
||||
GTK_PRIVATE_PACKAGES="$ATK_PACKAGES $WAYLAND_PACKAGES $MIR_PACKAGES epoxy >= epoxy_required_version"
|
||||
if test "x$enable_x11_backend" = xyes -o "x$enable_wayland_backend" = xyes; then
|
||||
GTK_PRIVATE_PACKAGES="$GTK_PRIVATE_PACKAGES pangoft2"
|
||||
fi
|
||||
|
||||
@@ -50,6 +50,7 @@
|
||||
<property name="can_focus">1</property>
|
||||
<property name="receives_default">1</property>
|
||||
<property name="font">Sans 12</property>
|
||||
<property name="level">style|size|variations|features</property>
|
||||
<signal name="font-set" handler="font_changed" swapped="no"/>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
@@ -10,6 +10,6 @@ body { overflow: hidden; }
|
||||
<script type="text/javascript" src="broadway.js"></script>
|
||||
</head>
|
||||
|
||||
<body onload="connect()" onclick="if (!document.hasFocus() && window.topElement !== window.self) { window.focus(); }">
|
||||
<body onload="connect()">
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -41,8 +41,6 @@
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <fribidi.h>
|
||||
|
||||
|
||||
/**
|
||||
* SECTION:general
|
||||
@@ -1115,20 +1113,3 @@ gdk_disable_multidevice (void)
|
||||
|
||||
_gdk_disable_multidevice = TRUE;
|
||||
}
|
||||
|
||||
PangoDirection
|
||||
gdk_unichar_direction (gunichar ch)
|
||||
{
|
||||
FriBidiCharType fribidi_ch_type;
|
||||
|
||||
G_STATIC_ASSERT (sizeof (FriBidiChar) == sizeof (gunichar));
|
||||
|
||||
fribidi_ch_type = fribidi_get_bidi_type (ch);
|
||||
|
||||
if (!FRIBIDI_IS_STRONG (fribidi_ch_type))
|
||||
return PANGO_DIRECTION_NEUTRAL;
|
||||
else if (FRIBIDI_IS_RTL (fribidi_ch_type))
|
||||
return PANGO_DIRECTION_RTL;
|
||||
else
|
||||
return PANGO_DIRECTION_LTR;
|
||||
}
|
||||
|
||||
@@ -442,8 +442,8 @@ _gdk_frame_clock_begin_frame (GdkFrameClock *frame_clock)
|
||||
* for the current frame or a recent frame. The #GdkFrameTimings
|
||||
* object may not yet be complete: see gdk_frame_timings_get_complete().
|
||||
*
|
||||
* Returns: (nullable) (transfer none): the #GdkFrameTimings object for
|
||||
* the specified frame, or %NULL if it is not available. See
|
||||
* Returns: (nullable): the #GdkFrameTimings object for the specified
|
||||
* frame, or %NULL if it is not available. See
|
||||
* gdk_frame_clock_get_history_start().
|
||||
* Since: 3.8
|
||||
*/
|
||||
@@ -475,10 +475,10 @@ gdk_frame_clock_get_timings (GdkFrameClock *frame_clock,
|
||||
*
|
||||
* Gets the frame timings for the current frame.
|
||||
*
|
||||
* Returns: (nullable) (transfer none): the #GdkFrameTimings for the
|
||||
* frame currently being processed, or even no frame is being
|
||||
* processed, for the previous frame. Before any frames have been
|
||||
* processed, returns %NULL.
|
||||
* Returns: (nullable): the #GdkFrameTimings for the frame currently
|
||||
* being processed, or even no frame is being processed, for the
|
||||
* previous frame. Before any frames have been processed, returns
|
||||
* %NULL.
|
||||
* Since: 3.8
|
||||
*/
|
||||
GdkFrameTimings *
|
||||
|
||||
@@ -558,8 +558,6 @@ cairo_surface_t * _gdk_offscreen_window_create_surface (GdkWindow *window,
|
||||
gint width,
|
||||
gint height);
|
||||
|
||||
PangoDirection gdk_unichar_direction (gunichar ch);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GDK_INTERNALS_H__ */
|
||||
|
||||
@@ -10275,7 +10275,7 @@ gdk_window_create_similar_image_surface (GdkWindow * window,
|
||||
* @window: a #GdkWindow
|
||||
* @timestamp: timestamp of the event triggering the window focus
|
||||
*
|
||||
* Sets keyboard focus to @window. In most cases, gtk_window_present_with_time()
|
||||
* Sets keyboard focus to @window. In most cases, gtk_window_present()
|
||||
* should be used on a #GtkWindow, rather than calling this function.
|
||||
*
|
||||
**/
|
||||
@@ -10749,7 +10749,7 @@ gdk_window_iconify (GdkWindow *window)
|
||||
* Attempt to deiconify (unminimize) @window. On X11 the window manager may
|
||||
* choose to ignore the request to deiconify. When using GTK+,
|
||||
* use gtk_window_deiconify() instead of the #GdkWindow variant. Or better yet,
|
||||
* you probably want to use gtk_window_present_with_time(), which raises the window, focuses it,
|
||||
* you probably want to use gtk_window_present(), which raises the window, focuses it,
|
||||
* unminimizes it, and puts it on the current desktop.
|
||||
*
|
||||
**/
|
||||
|
||||
@@ -278,7 +278,7 @@
|
||||
screen:screen];
|
||||
|
||||
[self setAcceptsMouseMovedEvents:YES];
|
||||
[self setDelegate:(id<NSWindowDelegate>)self];
|
||||
[self setDelegate:self];
|
||||
[self setReleasedWhenClosed:YES];
|
||||
|
||||
return self;
|
||||
@@ -384,34 +384,40 @@
|
||||
{
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101400
|
||||
if (gdk_quartz_osx_version () >= GDK_OSX_MOJAVE)
|
||||
return [super convertPointToScreen: point];
|
||||
{
|
||||
return [super convertPointToScreen: point];
|
||||
}
|
||||
#endif
|
||||
if (gdk_quartz_osx_version () >= GDK_OSX_LION)
|
||||
{
|
||||
NSRect inrect = NSMakeRect (point.x, point.y, 0.0, 0.0);
|
||||
NSRect outrect = [self convertRectToScreen: inrect];
|
||||
return (NSPoint)((CGRect)outrect).origin;
|
||||
}
|
||||
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
|
||||
if (gdk_quartz_osx_version () < GDK_OSX_LION)
|
||||
return [self convertBaseToScreen:point];
|
||||
return [self convertBaseToScreen:point];
|
||||
#endif
|
||||
{
|
||||
NSRect inrect = NSMakeRect (point.x, point.y, 0.0, 0.0);
|
||||
NSRect outrect = [self convertRectToScreen: inrect];
|
||||
return outrect.origin;
|
||||
}
|
||||
}
|
||||
|
||||
- (NSPoint)convertPointFromScreen:(NSPoint)point
|
||||
{
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101400
|
||||
if (gdk_quartz_osx_version () >= GDK_OSX_MOJAVE)
|
||||
return [super convertPointFromScreen: point];
|
||||
{
|
||||
return [super convertPointFromScreen: point];
|
||||
}
|
||||
#endif
|
||||
if (gdk_quartz_osx_version () >= GDK_OSX_LION)
|
||||
{
|
||||
NSRect inrect = NSMakeRect (point.x, point.y, 0.0, 0.0);
|
||||
NSRect outrect = [self convertRectFromScreen: inrect];
|
||||
return (NSPoint)((CGRect)outrect).origin;
|
||||
}
|
||||
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
|
||||
if (gdk_quartz_osx_version () < GDK_OSX_LION)
|
||||
return [self convertScreenToBase:point];
|
||||
return [self convertScreenToBase:point];
|
||||
#endif
|
||||
{
|
||||
NSRect inrect = NSMakeRect (point.x, point.y, 0.0, 0.0);
|
||||
NSRect outrect = [self convertRectFromScreen: inrect];
|
||||
return outrect.origin;
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL)trackManualMove
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
if ((self = [super initWithFrame: frameRect]))
|
||||
{
|
||||
markedRange = NSMakeRange (NSNotFound, 0);
|
||||
selectedRange = NSMakeRange (0, 0);
|
||||
selectedRange = NSMakeRange (NSNotFound, 0);
|
||||
}
|
||||
|
||||
return self;
|
||||
@@ -57,16 +57,6 @@
|
||||
|
||||
-(void) keyDown: (NSEvent *) theEvent
|
||||
{
|
||||
/* NOTE: When user press Cmd+A, interpretKeyEvents: will call noop:
|
||||
method. When user press and hold A to show the accented char window,
|
||||
it consumed repeating key down events for key 'A' do NOT call
|
||||
any other method. We use this behavior to determine if this key
|
||||
down event is filtered by interpretKeyEvents.
|
||||
*/
|
||||
|
||||
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
|
||||
GUINT_TO_POINTER (GIC_FILTER_FILTERED));
|
||||
|
||||
GDK_NOTE (EVENTS, g_message ("keyDown"));
|
||||
[self interpretKeyEvents: [NSArray arrayWithObject: theEvent]];
|
||||
}
|
||||
@@ -134,8 +124,7 @@
|
||||
-(void)unmarkText
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_message ("unmarkText"));
|
||||
selectedRange = NSMakeRange (0, 0);
|
||||
markedRange = NSMakeRange (NSNotFound, 0);
|
||||
markedRange = selectedRange = NSMakeRange (NSNotFound, 0);
|
||||
|
||||
g_object_set_data_full (G_OBJECT (gdk_window), TIC_MARKED_TEXT, NULL, g_free);
|
||||
}
|
||||
@@ -220,15 +209,8 @@
|
||||
else
|
||||
{
|
||||
str = [string UTF8String];
|
||||
selectedRange = NSMakeRange ([string length], 0);
|
||||
}
|
||||
|
||||
if (replacementRange.length > 0)
|
||||
{
|
||||
g_object_set_data (G_OBJECT (gdk_window), TIC_INSERT_TEXT_REPLACE_LEN,
|
||||
GINT_TO_POINTER (replacementRange.length));
|
||||
}
|
||||
|
||||
g_object_set_data_full (G_OBJECT (gdk_window), TIC_INSERT_TEXT, g_strdup (str), g_free);
|
||||
GDK_NOTE (EVENTS, g_message ("insertText: set %s (%p, nsview %p): %s",
|
||||
TIC_INSERT_TEXT, gdk_window, self,
|
||||
@@ -555,8 +537,6 @@
|
||||
-(void)noop: (id)sender
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_message ("noop"));
|
||||
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
|
||||
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------- */
|
||||
@@ -727,9 +707,6 @@
|
||||
|
||||
-(void)setFrame: (NSRect)frame
|
||||
{
|
||||
if (GDK_WINDOW_DESTROYED (gdk_window))
|
||||
return;
|
||||
|
||||
[super setFrame: frame];
|
||||
|
||||
if ([self window])
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
#define TIC_SELECTED_POS "tic-selected-pos"
|
||||
#define TIC_SELECTED_LEN "tic-selected-len"
|
||||
#define TIC_INSERT_TEXT "tic-insert-text"
|
||||
#define TIC_INSERT_TEXT_REPLACE_LEN "tic-insert-text-replace-len"
|
||||
#define TIC_IN_KEY_DOWN "tic-in-key-down"
|
||||
|
||||
/* GtkIMContext */
|
||||
|
||||
@@ -32,34 +32,6 @@
|
||||
#include "gdkdisplay-quartz.h"
|
||||
#include "gdkmonitor-quartz.h"
|
||||
|
||||
/* Note about coordinates: There are three coordinate systems at play:
|
||||
*
|
||||
* 1. Core Graphics starts at the origin at the upper right of the
|
||||
* main window (the one with the menu bar when you look at arrangement
|
||||
* in System Preferences>Displays) and increases down and to the
|
||||
* right; up and to the left are negative values of y and x
|
||||
* respectively.
|
||||
*
|
||||
* 2. AppKit (functions beginning with "NS" for NextStep) coordinates
|
||||
* also have their origin at the main window, but it's the *lower*
|
||||
* left corner and coordinates increase up and to the
|
||||
* right. Coordinates below or left of the origin are negative.
|
||||
*
|
||||
* 3. Gdk coordinates origin is at the upper left corner of the
|
||||
* imaginary rectangle enclosing all monitors and like Core Graphics
|
||||
* increase down and to the right. There are no negative coordinates.
|
||||
*
|
||||
* We need to deal with all three because AppKit's NSScreen array is
|
||||
* recomputed with new pointers whenever the monitor arrangement
|
||||
* changes so we can't cache the references it provides. CoreGraphics
|
||||
* screen IDs are constant between reboots so those are what we use to
|
||||
* map GdkMonitors and screens, but the sizes and origins must be
|
||||
* converted to Gdk coordinates to make sense to Gdk and we must
|
||||
* frequently convert between Gdk and AppKit coordinates when
|
||||
* determining the drawable area of a monitor and placing windows and
|
||||
* views (the latter containing our cairo surfaces for drawing on).
|
||||
*/
|
||||
|
||||
static gint MONITORS_CHANGED = 0;
|
||||
|
||||
static void display_reconfiguration_callback (CGDirectDisplayID display,
|
||||
@@ -248,45 +220,32 @@ gdk_quartz_display_pop_error_trap (GdkDisplay *display, gboolean ignore)
|
||||
*/
|
||||
|
||||
int
|
||||
get_active_displays (CGDirectDisplayID **displays)
|
||||
get_active_displays (CGDirectDisplayID **screens)
|
||||
{
|
||||
unsigned int n_displays = 0;
|
||||
unsigned int displays = 0;
|
||||
|
||||
CGGetActiveDisplayList (0, NULL, &n_displays);
|
||||
if (displays)
|
||||
CGGetActiveDisplayList (0, NULL, &displays);
|
||||
if (screens)
|
||||
{
|
||||
*displays = g_new0 (CGDirectDisplayID, n_displays);
|
||||
CGGetActiveDisplayList (n_displays, *displays, &n_displays);
|
||||
*screens = g_new0 (CGDirectDisplayID, displays);
|
||||
CGGetActiveDisplayList (displays, *screens, &displays);
|
||||
}
|
||||
|
||||
return n_displays;
|
||||
}
|
||||
|
||||
static inline GdkRectangle
|
||||
cgrect_to_gdkrect (CGRect cgrect)
|
||||
{
|
||||
GdkRectangle gdkrect = {(int)trunc (cgrect.origin.x),
|
||||
(int)trunc (cgrect.origin.y),
|
||||
(int)trunc (cgrect.size.width),
|
||||
(int)trunc (cgrect.size.height)};
|
||||
return gdkrect;
|
||||
return displays;
|
||||
}
|
||||
|
||||
static void
|
||||
configure_monitor (GdkMonitor *monitor,
|
||||
GdkQuartzDisplay *display)
|
||||
configure_monitor (GdkMonitor *monitor)
|
||||
{
|
||||
GdkQuartzMonitor *quartz_monitor = GDK_QUARTZ_MONITOR (monitor);
|
||||
CGSize disp_size = CGDisplayScreenSize (quartz_monitor->id);
|
||||
gint width = (int)trunc (disp_size.width);
|
||||
gint height = (int)trunc (disp_size.height);
|
||||
CGRect disp_bounds = CGDisplayBounds (quartz_monitor->id);
|
||||
CGRect main_bounds = CGDisplayBounds (CGMainDisplayID());
|
||||
/* Change origin to Gdk coordinates. */
|
||||
disp_bounds.origin.x = disp_bounds.origin.x + display->geometry.origin.x;
|
||||
disp_bounds.origin.y =
|
||||
display->geometry.origin.y - main_bounds.size.height + disp_bounds.origin.y;
|
||||
GdkRectangle disp_geometry = cgrect_to_gdkrect (disp_bounds);
|
||||
GdkRectangle disp_geometry = {(int)trunc (disp_bounds.origin.x),
|
||||
(int)trunc (disp_bounds.origin.y),
|
||||
(int)trunc (disp_bounds.size.width),
|
||||
(int)trunc (disp_bounds.size.height)};
|
||||
CGDisplayModeRef mode = CGDisplayCopyDisplayMode (quartz_monitor->id);
|
||||
gint refresh_rate = (int)trunc (CGDisplayModeGetRefreshRate (mode));
|
||||
|
||||
@@ -306,58 +265,13 @@ configure_monitor (GdkMonitor *monitor,
|
||||
monitor->subpixel_layout = GDK_SUBPIXEL_LAYOUT_UNKNOWN;
|
||||
}
|
||||
|
||||
static void
|
||||
display_rect (GdkQuartzDisplay *display)
|
||||
{
|
||||
uint32_t disp, n_displays = 0;
|
||||
float min_x = 0.0, max_x = 0.0, min_y = 0.0, max_y = 0.0;
|
||||
float min_x_mm = 0.0, max_x_mm = 0.0, min_y_mm = 0.0, max_y_mm = 0.0;
|
||||
float main_height;
|
||||
CGDirectDisplayID *displays;
|
||||
|
||||
n_displays = get_active_displays (&displays);
|
||||
for (disp = 0; disp < n_displays; ++disp)
|
||||
{
|
||||
CGRect bounds = CGDisplayBounds (displays[disp]);
|
||||
CGSize disp_size = CGDisplayScreenSize (displays[disp]);
|
||||
float x_scale = disp_size.width / bounds.size.width;
|
||||
float y_scale = disp_size.height / bounds.size.height;
|
||||
if (disp == 0)
|
||||
main_height = bounds.size.height;
|
||||
min_x = MIN (min_x, bounds.origin.x);
|
||||
min_y = MIN (min_y, bounds.origin.y);
|
||||
|
||||
max_x = MAX (max_x, bounds.origin.x + bounds.size.width);
|
||||
max_y = MAX (max_y, bounds.origin.y + bounds.size.height);
|
||||
min_x_mm = MIN (min_x_mm, bounds.origin.x / x_scale);
|
||||
min_y_mm = MIN (min_y_mm, main_height - (bounds.size.height + bounds.origin.y) / y_scale);
|
||||
max_x_mm = MAX (max_x_mm, (bounds.origin.x + bounds.size.width) / x_scale);
|
||||
max_y_mm = MAX (max_y_mm, (bounds.origin.y + bounds.size.height) / y_scale);
|
||||
|
||||
}
|
||||
g_free (displays);
|
||||
/* Adjusts the origin to AppKit coordinates. */
|
||||
display->geometry = NSMakeRect (-min_x, main_height - min_y,
|
||||
max_x - min_x, max_y - min_y);
|
||||
display->size = NSMakeSize (max_x_mm - min_x_mm, max_y_mm - min_y_mm);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
same_monitor (gconstpointer a, gconstpointer b)
|
||||
{
|
||||
GdkQuartzMonitor *mon_a = GDK_QUARTZ_MONITOR (a);
|
||||
CGDirectDisplayID disp_id = (CGDirectDisplayID)GPOINTER_TO_INT (b);
|
||||
if (!mon_a)
|
||||
return FALSE;
|
||||
return mon_a->id == disp_id;
|
||||
}
|
||||
|
||||
static void
|
||||
display_reconfiguration_callback (CGDirectDisplayID cg_display,
|
||||
CGDisplayChangeSummaryFlags flags,
|
||||
void *data)
|
||||
{
|
||||
GdkQuartzDisplay *display = data;
|
||||
GdkQuartzMonitor *monitor;
|
||||
|
||||
/* Ignore the begin configuration signal. */
|
||||
if (flags & kCGDisplayBeginConfigurationFlag)
|
||||
@@ -367,44 +281,27 @@ display_reconfiguration_callback (CGDirectDisplayID cg_display,
|
||||
kCGDisplaySetMainFlag | kCGDisplayDesktopShapeChangedFlag |
|
||||
kCGDisplayMirrorFlag | kCGDisplayUnMirrorFlag))
|
||||
{
|
||||
GdkQuartzMonitor *monitor = NULL;
|
||||
guint index;
|
||||
|
||||
if (!g_ptr_array_find_with_equal_func (display->monitors,
|
||||
GINT_TO_POINTER (cg_display),
|
||||
same_monitor,
|
||||
&index))
|
||||
monitor = g_hash_table_lookup (display->monitors,
|
||||
GINT_TO_POINTER (cg_display));
|
||||
if (!monitor)
|
||||
{
|
||||
monitor = g_object_new (GDK_TYPE_QUARTZ_MONITOR,
|
||||
"display", display, NULL);
|
||||
monitor->id = cg_display;
|
||||
g_ptr_array_add (display->monitors, monitor);
|
||||
g_hash_table_insert (display->monitors, GINT_TO_POINTER (monitor->id),
|
||||
monitor);
|
||||
gdk_display_monitor_added (GDK_DISPLAY (display),
|
||||
GDK_MONITOR (monitor));
|
||||
}
|
||||
else
|
||||
{
|
||||
monitor = g_ptr_array_index (display->monitors, index);
|
||||
}
|
||||
|
||||
display_rect (display);
|
||||
configure_monitor (GDK_MONITOR (monitor), display);
|
||||
configure_monitor (GDK_MONITOR (monitor));
|
||||
}
|
||||
else if (flags & (kCGDisplayRemoveFlag | kCGDisplayDisabledFlag))
|
||||
{
|
||||
guint index;
|
||||
|
||||
if (g_ptr_array_find_with_equal_func (display->monitors,
|
||||
GINT_TO_POINTER (cg_display),
|
||||
same_monitor,
|
||||
&index))
|
||||
{
|
||||
GdkQuartzMonitor *monitor = g_ptr_array_index (display->monitors,
|
||||
index);
|
||||
gdk_display_monitor_removed (GDK_DISPLAY (display),
|
||||
GDK_MONITOR (monitor));
|
||||
g_ptr_array_remove_fast (display->monitors, monitor);
|
||||
}
|
||||
GdkMonitor *monitor = g_hash_table_lookup (display->monitors,
|
||||
GINT_TO_POINTER (cg_display));
|
||||
gdk_display_monitor_removed (GDK_DISPLAY (display),
|
||||
GDK_MONITOR (monitor));
|
||||
g_hash_table_remove (display->monitors, GINT_TO_POINTER (cg_display));
|
||||
}
|
||||
|
||||
g_signal_emit (display, MONITORS_CHANGED, 0);
|
||||
@@ -414,8 +311,7 @@ display_reconfiguration_callback (CGDirectDisplayID cg_display,
|
||||
static int
|
||||
gdk_quartz_display_get_n_monitors (GdkDisplay *display)
|
||||
{
|
||||
GdkQuartzDisplay *quartz_display = GDK_QUARTZ_DISPLAY (display);
|
||||
return quartz_display->monitors->len;
|
||||
return get_active_displays (NULL);
|
||||
}
|
||||
|
||||
static GdkMonitor *
|
||||
@@ -423,10 +319,13 @@ gdk_quartz_display_get_monitor (GdkDisplay *display,
|
||||
int monitor_num)
|
||||
{
|
||||
GdkQuartzDisplay *quartz_display = GDK_QUARTZ_DISPLAY (display);
|
||||
int n_displays = gdk_quartz_display_get_n_monitors (display);
|
||||
CGDirectDisplayID *screens = NULL;
|
||||
|
||||
if (monitor_num >= 0 && monitor_num < n_displays)
|
||||
return g_ptr_array_index (quartz_display->monitors, monitor_num);
|
||||
int count = get_active_displays (&screens);
|
||||
|
||||
if (monitor_num >= 0 && monitor_num < count)
|
||||
return g_hash_table_lookup (quartz_display->monitors,
|
||||
GINT_TO_POINTER (screens[monitor_num]));
|
||||
|
||||
return NULL;
|
||||
}
|
||||
@@ -436,15 +335,9 @@ gdk_quartz_display_get_primary_monitor (GdkDisplay *display)
|
||||
{
|
||||
GdkQuartzDisplay *quartz_display = GDK_QUARTZ_DISPLAY (display);
|
||||
CGDirectDisplayID primary_id = CGMainDisplayID ();
|
||||
GdkMonitor *monitor = NULL;
|
||||
guint index;
|
||||
|
||||
if (g_ptr_array_find_with_equal_func (quartz_display->monitors,
|
||||
GINT_TO_POINTER (primary_id),
|
||||
same_monitor, &index))
|
||||
monitor = g_ptr_array_index (quartz_display->monitors, index);
|
||||
|
||||
return monitor;
|
||||
return g_hash_table_lookup (quartz_display->monitors,
|
||||
GINT_TO_POINTER (primary_id));
|
||||
}
|
||||
|
||||
static GdkMonitor *
|
||||
@@ -454,27 +347,10 @@ gdk_quartz_display_get_monitor_at_window (GdkDisplay *display,
|
||||
GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
|
||||
NSWindow *nswindow = impl->toplevel;
|
||||
NSScreen *screen = [nswindow screen];
|
||||
GdkMonitor *monitor = NULL;
|
||||
if (screen)
|
||||
{
|
||||
GdkQuartzDisplay *quartz_display = GDK_QUARTZ_DISPLAY (display);
|
||||
guint index;
|
||||
CGDirectDisplayID disp_id =
|
||||
[[[screen deviceDescription]
|
||||
objectForKey: @"NSScreenNumber"] unsignedIntValue];
|
||||
if (g_ptr_array_find_with_equal_func (quartz_display->monitors,
|
||||
GINT_TO_POINTER (disp_id),
|
||||
same_monitor, &index))
|
||||
monitor = g_ptr_array_index (quartz_display->monitors, index);
|
||||
}
|
||||
if (!monitor)
|
||||
{
|
||||
GdkRectangle rect = cgrect_to_gdkrect ([nswindow frame]);
|
||||
monitor = gdk_display_get_monitor_at_point (display,
|
||||
rect.x + rect.width/2,
|
||||
rect.y + rect.height /2);
|
||||
}
|
||||
return monitor;
|
||||
CGDirectDisplayID id = [[[screen deviceDescription]
|
||||
objectForKey: @"NSScreenNumber"] unsignedIntValue];
|
||||
return g_hash_table_lookup (GDK_QUARTZ_DISPLAY (display)->monitors,
|
||||
GINT_TO_POINTER (id));
|
||||
}
|
||||
|
||||
G_DEFINE_TYPE (GdkQuartzDisplay, gdk_quartz_display, GDK_TYPE_DISPLAY)
|
||||
@@ -482,35 +358,36 @@ G_DEFINE_TYPE (GdkQuartzDisplay, gdk_quartz_display, GDK_TYPE_DISPLAY)
|
||||
static void
|
||||
gdk_quartz_display_init (GdkQuartzDisplay *display)
|
||||
{
|
||||
uint32_t n_displays = 0, disp;
|
||||
uint32_t max_displays = 0, disp;
|
||||
CGDirectDisplayID *displays;
|
||||
|
||||
display_rect(display); /* Initialize the overall display coordinates. */
|
||||
n_displays = get_active_displays (&displays);
|
||||
display->monitors = g_ptr_array_new_full (n_displays, g_object_unref);
|
||||
for (disp = 0; disp < n_displays; ++disp)
|
||||
CGGetActiveDisplayList (0, NULL, &max_displays);
|
||||
display->monitors = g_hash_table_new_full (g_direct_hash, NULL,
|
||||
NULL, g_object_unref);
|
||||
displays = g_new0 (CGDirectDisplayID, max_displays);
|
||||
CGGetActiveDisplayList (max_displays, displays, &max_displays);
|
||||
for (disp = 0; disp < max_displays; ++disp)
|
||||
{
|
||||
GdkQuartzMonitor *monitor = g_object_new (GDK_TYPE_QUARTZ_MONITOR,
|
||||
"display", display, NULL);
|
||||
monitor->id = displays[disp];
|
||||
g_ptr_array_add (display->monitors, monitor);
|
||||
configure_monitor (GDK_MONITOR (monitor), display);
|
||||
g_hash_table_insert (display->monitors, GINT_TO_POINTER (monitor->id),
|
||||
monitor);
|
||||
configure_monitor (GDK_MONITOR (monitor));
|
||||
}
|
||||
g_free (displays);
|
||||
CGDisplayRegisterReconfigurationCallback (display_reconfiguration_callback,
|
||||
display);
|
||||
/* So that monitors changed will keep display->geometry syncronized. */
|
||||
g_signal_emit (display, MONITORS_CHANGED, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_quartz_display_dispose (GObject *object)
|
||||
{
|
||||
GdkQuartzDisplay *quartz_display = GDK_QUARTZ_DISPLAY (object);
|
||||
GdkQuartzDisplay *display_quartz = GDK_QUARTZ_DISPLAY (object);
|
||||
|
||||
g_ptr_array_free (quartz_display->monitors, TRUE);
|
||||
g_hash_table_destroy (display_quartz->monitors);
|
||||
CGDisplayRemoveReconfigurationCallback (display_reconfiguration_callback,
|
||||
quartz_display);
|
||||
display_quartz);
|
||||
|
||||
G_OBJECT_CLASS (gdk_quartz_display_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
@@ -32,9 +32,7 @@ G_BEGIN_DECLS
|
||||
struct _GdkQuartzDisplay
|
||||
{
|
||||
GdkDisplay parent_instance;
|
||||
NSRect geometry; /* In AppKit coordinates. */
|
||||
NSSize size; /* Aggregate size of displays in millimeters. */
|
||||
GPtrArray *monitors;
|
||||
GHashTable *monitors;
|
||||
};
|
||||
|
||||
struct _GdkQuartzDisplayClass
|
||||
|
||||
@@ -629,15 +629,33 @@ find_toplevel_under_pointer (GdkDisplay *display,
|
||||
static GdkWindow *
|
||||
find_toplevel_for_keyboard_event (NSEvent *nsevent)
|
||||
{
|
||||
GdkQuartzView *view = (GdkQuartzView *)[[nsevent window] contentView];
|
||||
GdkWindow *window = [view gdkWindow];
|
||||
GdkDisplay *display = gdk_window_get_display (window);
|
||||
GdkSeat *seat = gdk_display_get_default_seat (display);
|
||||
GdkDevice *device = gdk_seat_get_keyboard (seat);
|
||||
GdkDeviceGrabInfo *grab = _gdk_display_get_last_device_grab (display, device);
|
||||
GList *list, *l;
|
||||
GdkWindow *window;
|
||||
GdkDisplay *display;
|
||||
GdkQuartzView *view;
|
||||
GdkSeat *seat;
|
||||
|
||||
if (grab && grab->window && !grab->owner_events)
|
||||
window = gdk_window_get_effective_toplevel (grab->window);
|
||||
view = (GdkQuartzView *)[[nsevent window] contentView];
|
||||
window = [view gdkWindow];
|
||||
|
||||
display = gdk_window_get_display (window);
|
||||
seat = gdk_display_get_default_seat (display);
|
||||
|
||||
list = gdk_seat_get_slaves (seat, GDK_SEAT_CAPABILITY_KEYBOARD);
|
||||
for (l = list; l; l = l->next)
|
||||
{
|
||||
GdkDeviceGrabInfo *grab;
|
||||
GdkDevice *device = l->data;
|
||||
|
||||
grab = _gdk_display_get_last_device_grab (display, device);
|
||||
if (grab && grab->window && !grab->owner_events)
|
||||
{
|
||||
window = gdk_window_get_effective_toplevel (grab->window);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
g_list_free (list);
|
||||
|
||||
return window;
|
||||
}
|
||||
@@ -1522,9 +1540,6 @@ gdk_event_translate (GdkEvent *event,
|
||||
|
||||
grab = _gdk_display_get_last_device_grab (_gdk_display,
|
||||
gdk_seat_get_pointer (seat));
|
||||
if (!grab)
|
||||
[impl->toplevel makeKeyWindow];
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#include <gio/gio.h>
|
||||
|
||||
#include "gdkmonitor-quartz.h"
|
||||
#include "gdkdisplay-quartz.h"
|
||||
#include "gdkscreen-quartz.h"
|
||||
|
||||
|
||||
G_DEFINE_TYPE (GdkQuartzMonitor, gdk_quartz_monitor, GDK_TYPE_MONITOR)
|
||||
@@ -30,30 +30,19 @@ static void
|
||||
gdk_quartz_monitor_get_workarea (GdkMonitor *monitor,
|
||||
GdkRectangle *dest)
|
||||
{
|
||||
GdkQuartzScreen *quartz_screen = GDK_QUARTZ_SCREEN(gdk_display_get_default_screen (monitor->display));
|
||||
GdkQuartzMonitor *quartz_monitor = GDK_QUARTZ_MONITOR(monitor);
|
||||
|
||||
GDK_QUARTZ_ALLOC_POOL;
|
||||
|
||||
NSArray *array = [NSScreen screens];
|
||||
NSScreen* screen;
|
||||
for (id obj in array)
|
||||
if (quartz_monitor->monitor_num < [array count])
|
||||
{
|
||||
CGDirectDisplayID screen_id =
|
||||
[[[obj deviceDescription] objectForKey:@"NSScreenNumber"] unsignedIntValue];
|
||||
GdkQuartzMonitor *q_mon = GDK_QUARTZ_MONITOR (monitor);
|
||||
if (screen_id == q_mon->id)
|
||||
{
|
||||
screen = obj;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (screen)
|
||||
{
|
||||
GdkQuartzDisplay *display =
|
||||
GDK_QUARTZ_DISPLAY (gdk_monitor_get_display (monitor));
|
||||
NSScreen *screen = [array objectAtIndex:quartz_monitor->monitor_num];
|
||||
NSRect rect = [screen visibleFrame];
|
||||
dest->x = (int)trunc (display->geometry.origin.x + rect.origin.x);
|
||||
dest->y = (int)trunc (display->geometry.origin.y -
|
||||
rect.origin.y - rect.size.height);
|
||||
|
||||
dest->x = rect.origin.x - quartz_screen->min_x;
|
||||
dest->y = quartz_screen->height - (rect.origin.y + rect.size.height) + quartz_screen->min_y;
|
||||
dest->width = rect.size.width;
|
||||
dest->height = rect.size.height;
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
struct _GdkQuartzMonitor
|
||||
{
|
||||
GdkMonitor parent;
|
||||
gint monitor_num;
|
||||
CGDirectDisplayID id;
|
||||
};
|
||||
|
||||
|
||||
@@ -60,12 +60,11 @@
|
||||
* but GDK coordinates can *not*!
|
||||
*/
|
||||
|
||||
static void gdk_quartz_screen_dispose (GObject *object);
|
||||
static void gdk_quartz_screen_finalize (GObject *object);
|
||||
static void gdk_quartz_screen_calculate_layout (GdkQuartzScreen *screen,
|
||||
GdkQuartzDisplay *display);
|
||||
static void gdk_quartz_screen_reconfigure (GdkQuartzDisplay *display,
|
||||
GdkQuartzScreen *screen);
|
||||
static void gdk_quartz_screen_dispose (GObject *object);
|
||||
static void gdk_quartz_screen_finalize (GObject *object);
|
||||
static void gdk_quartz_screen_calculate_layout (GdkQuartzScreen *screen);
|
||||
static void gdk_quartz_screen_reconfigure (GdkQuartzDisplay *dispplay,
|
||||
GdkQuartzScreen *screen);
|
||||
|
||||
static const double dpi = 72.0;
|
||||
|
||||
@@ -89,7 +88,7 @@ gdk_quartz_screen_init (GdkQuartzScreen *quartz_screen)
|
||||
G_CALLBACK (gdk_quartz_screen_reconfigure), quartz_screen);
|
||||
/* The first monitors-changed should have fired already. */
|
||||
_gdk_screen_set_resolution (screen, dpi);
|
||||
gdk_quartz_screen_calculate_layout (quartz_screen, NULL);
|
||||
gdk_quartz_screen_calculate_layout (quartz_screen);
|
||||
quartz_screen->emit_monitors_changed = FALSE;
|
||||
}
|
||||
|
||||
@@ -119,24 +118,45 @@ gdk_quartz_screen_finalize (GObject *object)
|
||||
@end
|
||||
|
||||
static void
|
||||
gdk_quartz_screen_calculate_layout (GdkQuartzScreen *screen,
|
||||
GdkQuartzDisplay *display)
|
||||
gdk_quartz_screen_calculate_layout (GdkQuartzScreen *screen)
|
||||
{
|
||||
int i, monitors;
|
||||
int max_x, max_y;
|
||||
GdkDisplay *display = gdk_screen_get_display (GDK_SCREEN (screen));
|
||||
|
||||
if (!display)
|
||||
display = GDK_QUARTZ_DISPLAY (gdk_screen_get_display (GDK_SCREEN (screen)));
|
||||
screen->width = 0;
|
||||
screen->height = 0;
|
||||
screen->min_x = 0;
|
||||
screen->min_y = 0;
|
||||
max_x = max_y = 0;
|
||||
screen->mm_width = 0;
|
||||
screen->mm_height = 0;
|
||||
|
||||
/* Display geometry is the origin and size in AppKit coordinates. AppKit computes */
|
||||
screen->width = (int)trunc (display->geometry.size.width);
|
||||
screen->height = (int)trunc (display->geometry.size.height);
|
||||
screen->orig_x = -(int)trunc (display->geometry.origin.x);
|
||||
screen->orig_y = (int)trunc (display->geometry.origin.y);
|
||||
screen->mm_width = (int)trunc (display->size.width);
|
||||
screen->mm_height = (int)trunc (display->size.height);
|
||||
/* We determine the minimum and maximum x and y coordinates
|
||||
* covered by the monitors. From this we can deduce the width
|
||||
* and height of the root screen.
|
||||
*/
|
||||
monitors = gdk_display_get_n_monitors (display);
|
||||
for (i = 0; i < monitors; ++i)
|
||||
{
|
||||
GdkQuartzMonitor *monitor =
|
||||
GDK_QUARTZ_MONITOR (gdk_display_get_monitor (display, i));
|
||||
GdkRectangle rect;
|
||||
|
||||
}
|
||||
gdk_monitor_get_geometry (GDK_MONITOR (monitor), &rect);
|
||||
screen->min_x = MIN (screen->min_x, rect.x);
|
||||
max_x = MAX (max_x, rect.x + rect.width);
|
||||
|
||||
screen->min_y = MIN (screen->min_y, rect.y);
|
||||
max_y = MAX (max_y, rect.y + rect.height);
|
||||
|
||||
screen->mm_height += GDK_MONITOR (monitor)->height_mm;
|
||||
screen->mm_width += GDK_MONITOR (monitor)->width_mm;
|
||||
}
|
||||
|
||||
screen->width = max_x - screen->min_x;
|
||||
screen->height = max_y - screen->min_y;
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_quartz_screen_update_window_sizes (GdkScreen *screen)
|
||||
@@ -181,7 +201,7 @@ gdk_quartz_screen_reconfigure (GdkQuartzDisplay *display, GdkQuartzScreen *scree
|
||||
width = gdk_screen_get_width (GDK_SCREEN (screen));
|
||||
height = gdk_screen_get_height (GDK_SCREEN (screen));
|
||||
|
||||
gdk_quartz_screen_calculate_layout (screen, display);
|
||||
gdk_quartz_screen_calculate_layout (GDK_QUARTZ_SCREEN (screen));
|
||||
|
||||
_gdk_quartz_screen_update_window_sizes (GDK_SCREEN (screen));
|
||||
|
||||
|
||||
@@ -29,9 +29,9 @@ struct _GdkQuartzScreen
|
||||
|
||||
GdkDisplay *display;
|
||||
|
||||
/* Origin of "root window" in AppKit coordinates */
|
||||
gint orig_x;
|
||||
gint orig_y;
|
||||
/* Origin of "root window" in Cocoa coordinates */
|
||||
gint min_x;
|
||||
gint min_y;
|
||||
|
||||
gint width;
|
||||
gint height;
|
||||
|
||||
@@ -430,6 +430,7 @@ _gdk_quartz_display_before_process_all_updates (GdkDisplay *display)
|
||||
void
|
||||
_gdk_quartz_display_after_process_all_updates (GdkDisplay *display)
|
||||
{
|
||||
GSList *old_update_nswindows = update_nswindows;
|
||||
GSList *tmp_list = update_nswindows;
|
||||
|
||||
update_nswindows = NULL;
|
||||
@@ -447,9 +448,11 @@ _gdk_quartz_display_after_process_all_updates (GdkDisplay *display)
|
||||
#endif
|
||||
[nswindow release];
|
||||
|
||||
tmp_list = g_slist_remove_link (tmp_list, tmp_list);
|
||||
tmp_list = tmp_list->next;
|
||||
}
|
||||
|
||||
g_slist_free (old_update_nswindows);
|
||||
|
||||
in_process_all_updates = FALSE;
|
||||
|
||||
if (gdk_quartz_osx_version() >= GDK_OSX_EL_CAPITAN)
|
||||
@@ -609,10 +612,10 @@ _gdk_quartz_window_gdk_xy_to_xy (gint gdk_x,
|
||||
GdkQuartzScreen *screen_quartz = GDK_QUARTZ_SCREEN (_gdk_screen);
|
||||
|
||||
if (ns_y)
|
||||
*ns_y = screen_quartz->orig_y - gdk_y;
|
||||
*ns_y = screen_quartz->height - gdk_y + screen_quartz->min_y;
|
||||
|
||||
if (ns_x)
|
||||
*ns_x = gdk_x + screen_quartz->orig_x;
|
||||
*ns_x = gdk_x + screen_quartz->min_x;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -624,10 +627,10 @@ _gdk_quartz_window_xy_to_gdk_xy (gint ns_x,
|
||||
GdkQuartzScreen *screen_quartz = GDK_QUARTZ_SCREEN (_gdk_screen);
|
||||
|
||||
if (gdk_y)
|
||||
*gdk_y = screen_quartz->orig_y - ns_y;
|
||||
*gdk_y = screen_quartz->height - ns_y + screen_quartz->min_y;
|
||||
|
||||
if (gdk_x)
|
||||
*gdk_x = ns_x - screen_quartz->orig_x;
|
||||
*gdk_x = ns_x - screen_quartz->min_x;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -2169,37 +2172,6 @@ _gdk_quartz_window_update_has_shadow (GdkWindowImplQuartz *impl)
|
||||
[impl->toplevel setHasShadow: has_shadow];
|
||||
}
|
||||
|
||||
static void
|
||||
_gdk_quartz_window_set_collection_behavior (NSWindow *nswindow,
|
||||
GdkWindowTypeHint hint)
|
||||
{
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
|
||||
if (gdk_quartz_osx_version() >= GDK_OSX_LION)
|
||||
{
|
||||
/* Fullscreen Collection Behavior */
|
||||
NSWindowCollectionBehavior behavior = [nswindow collectionBehavior];
|
||||
switch (hint)
|
||||
{
|
||||
case GDK_WINDOW_TYPE_HINT_NORMAL:
|
||||
case GDK_WINDOW_TYPE_HINT_SPLASHSCREEN:
|
||||
behavior &= ~(NSWindowCollectionBehaviorFullScreenAuxiliary &
|
||||
NSWindowCollectionBehaviorFullScreenDisallowsTiling);
|
||||
behavior |= (NSWindowCollectionBehaviorFullScreenPrimary |
|
||||
NSWindowCollectionBehaviorFullScreenAllowsTiling);
|
||||
|
||||
break;
|
||||
default:
|
||||
behavior &= ~(NSWindowCollectionBehaviorFullScreenPrimary &
|
||||
NSWindowCollectionBehaviorFullScreenAllowsTiling);
|
||||
behavior |= (NSWindowCollectionBehaviorFullScreenAuxiliary |
|
||||
NSWindowCollectionBehaviorFullScreenDisallowsTiling);
|
||||
break;
|
||||
}
|
||||
[nswindow setCollectionBehavior:behavior];
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_quartz_window_set_type_hint (GdkWindow *window,
|
||||
GdkWindowTypeHint hint)
|
||||
@@ -2219,8 +2191,6 @@ gdk_quartz_window_set_type_hint (GdkWindow *window,
|
||||
return;
|
||||
|
||||
_gdk_quartz_window_update_has_shadow (impl);
|
||||
if (impl->toplevel)
|
||||
_gdk_quartz_window_set_collection_behavior (impl->toplevel, hint);
|
||||
[impl->toplevel setLevel: window_type_hint_to_level (hint)];
|
||||
[impl->toplevel setHidesOnDeactivate: window_type_hint_to_hides_on_deactivate (hint)];
|
||||
}
|
||||
@@ -2472,6 +2442,7 @@ gdk_quartz_window_set_decorations (GdkWindow *window,
|
||||
if (new_mask == GDK_QUARTZ_BORDERLESS_WINDOW)
|
||||
{
|
||||
[impl->toplevel setContentSize:rect.size];
|
||||
[impl->toplevel setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary];
|
||||
}
|
||||
else
|
||||
[impl->toplevel setFrame:rect display:YES];
|
||||
@@ -2730,9 +2701,6 @@ _gdk_quartz_window_update_fullscreen_state (GdkWindow *window)
|
||||
gboolean is_fullscreen;
|
||||
gboolean was_fullscreen;
|
||||
|
||||
if (GDK_WINDOW_DESTROYED (window) || !WINDOW_IS_TOPLEVEL (window))
|
||||
return;
|
||||
|
||||
is_fullscreen = window_is_fullscreen (window);
|
||||
was_fullscreen = (gdk_window_get_state (window) & GDK_WINDOW_STATE_FULLSCREEN) != 0;
|
||||
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
#include <limits.h>
|
||||
#include <errno.h>
|
||||
#include <sys/mman.h>
|
||||
#include <fribidi.h>
|
||||
|
||||
#include "gdk.h"
|
||||
#include "gdkwayland.h"
|
||||
@@ -500,7 +499,7 @@ update_direction (GdkWaylandKeymap *keymap)
|
||||
{
|
||||
PangoDirection dir;
|
||||
|
||||
dir = gdk_unichar_direction (xkb_keysym_to_utf32 (syms[sym]));
|
||||
dir = pango_unichar_direction (xkb_keysym_to_utf32 (syms[sym]));
|
||||
switch (dir)
|
||||
{
|
||||
case PANGO_DIRECTION_RTL:
|
||||
|
||||
@@ -480,7 +480,7 @@ get_direction (XkbDescRec *xkb,
|
||||
{
|
||||
gint level = 0;
|
||||
KeySym sym = XkbKeySymEntry (xkb, code, level, group);
|
||||
PangoDirection dir = gdk_unichar_direction (gdk_keyval_to_unicode (sym));
|
||||
PangoDirection dir = pango_unichar_direction (gdk_keyval_to_unicode (sym));
|
||||
|
||||
switch (dir)
|
||||
{
|
||||
|
||||
@@ -1445,8 +1445,7 @@ gtkprivatetypebuiltins.c: $(gtk_private_type_h_sources) gtkprivatetypebuiltins.
|
||||
|
||||
|
||||
gtktypefuncs.c: stamp-gtktypebuiltins.h stamp-gtkprivatetypebuiltins.h $(top_srcdir)/gtk/*.h $(top_srcdir)/gtk/a11y/*.h $(top_srcdir)/gtk/deprecated/*.h $(top_srcdir)/gdk/*.h Makefile
|
||||
$(AM_V_GEN) export LC_ALL=C ; \
|
||||
(echo '#undef GTK_COMPILATION' && echo '#include <gtk/gtkx.h>') > xgen-gtfsrc.c && \
|
||||
$(AM_V_GEN) (echo '#undef GTK_COMPILATION' && echo '#include <gtk/gtkx.h>') > xgen-gtfsrc.c && \
|
||||
echo 'G_GNUC_BEGIN_IGNORE_DEPRECATIONS' > xgen-gtf && \
|
||||
${CPP} $(DEFS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) xgen-gtfsrc.c | \
|
||||
$(GREP) -o '\bg[td]k_[a-zA-Z0-9_]*_get_type\b' | \
|
||||
|
||||
@@ -123,7 +123,8 @@ atk_key_event_from_gdk_event_key (GdkEventKey *key,
|
||||
event->keyval = key->keyval;
|
||||
event->length = key->length;
|
||||
if (key->string && key->string[0] &&
|
||||
g_unichar_isgraph (g_utf8_get_char (key->string)))
|
||||
(key->state & GDK_CONTROL_MASK ||
|
||||
g_unichar_isgraph (g_utf8_get_char (key->string))))
|
||||
event->string = key->string;
|
||||
else
|
||||
event->string = gdk_keyval_name (key->keyval);
|
||||
|
||||
@@ -128,10 +128,10 @@ void gtk_cell_accessible_parent_get_cell_position(GtkCellAccessibleParent *p
|
||||
GtkCellAccessible *cell,
|
||||
gint *row,
|
||||
gint *column);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
|
||||
GPtrArray *gtk_cell_accessible_parent_get_column_header_cells (GtkCellAccessibleParent *parent,
|
||||
GtkCellAccessible *cell);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
|
||||
GPtrArray *gtk_cell_accessible_parent_get_row_header_cells (GtkCellAccessibleParent *parent,
|
||||
GtkCellAccessible *cell);
|
||||
|
||||
|
||||
@@ -626,11 +626,7 @@ gtk_icon_view_item_accessible_grab_focus (AtkComponent *component)
|
||||
_gtk_icon_view_set_cursor_item (GTK_ICON_VIEW (item->widget), item->item, NULL);
|
||||
toplevel = gtk_widget_get_toplevel (GTK_WIDGET (item->widget));
|
||||
if (gtk_widget_is_toplevel (toplevel))
|
||||
{
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
gtk_window_present (GTK_WINDOW (toplevel));
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
}
|
||||
gtk_window_present (GTK_WINDOW (toplevel));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -1179,11 +1179,7 @@ gtk_tree_view_accessible_grab_cell_focus (GtkCellAccessibleParent *parent,
|
||||
gdk_x11_get_server_time (gtk_widget_get_window (widget)));
|
||||
else
|
||||
#endif
|
||||
{
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
gtk_window_present (GTK_WINDOW (toplevel));
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
}
|
||||
gtk_window_present (GTK_WINDOW (toplevel));
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
||||
@@ -647,13 +647,8 @@ gtk_widget_accessible_grab_focus (AtkComponent *component)
|
||||
gdk_x11_get_server_time (gtk_widget_get_window (widget)));
|
||||
else
|
||||
#endif
|
||||
{
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
gtk_window_present (GTK_WINDOW (toplevel));
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
}
|
||||
gtk_window_present (GTK_WINDOW (toplevel));
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
@@ -995,9 +995,7 @@ preview_file (const char *filename,
|
||||
g_object_unref (widget);
|
||||
}
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
gtk_window_present (GTK_WINDOW (window));
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
|
||||
gtk_main ();
|
||||
|
||||
|
||||
@@ -1003,9 +1003,7 @@ gtk_about_dialog_activate_link (GtkAboutDialog *about,
|
||||
g_signal_connect (dialog, "response",
|
||||
G_CALLBACK (gtk_widget_destroy), NULL);
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
gtk_window_present (GTK_WINDOW (dialog));
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
@@ -2438,9 +2436,7 @@ gtk_show_about_dialog (GtkWindow *parent,
|
||||
|
||||
}
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
gtk_window_present (GTK_WINDOW (dialog));
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1006,22 +1006,9 @@ gtk_clipboard_wait_is_uris_available (GtkClipboard *clipboard)
|
||||
|
||||
/**
|
||||
* gtk_clipboard_wait_for_targets:
|
||||
* @clipboard: a #GtkClipboard
|
||||
* @targets: (out) (array length=n_targets) (transfer container): location
|
||||
* to store an array of targets. The result stored here must
|
||||
* be freed with g_free().
|
||||
* @n_targets: (out): location to store number of items in @targets.
|
||||
*
|
||||
* Returns a list of targets that are present on the clipboard, or %NULL
|
||||
* if there aren’t any targets available. The returned list must be
|
||||
* freed with g_free().
|
||||
* This function waits for the data to be received using the main
|
||||
* loop, so events, timeouts, etc, may be dispatched during the wait.
|
||||
*
|
||||
* Returns: %TRUE if any targets are present on the clipboard,
|
||||
* otherwise %FALSE.
|
||||
*
|
||||
* Since: 2.4
|
||||
* @clipboard:
|
||||
* @targets: (out) (array length=n_targets):
|
||||
* @n_targets: (out):
|
||||
*/
|
||||
gboolean
|
||||
gtk_clipboard_wait_for_targets (GtkClipboard *clipboard,
|
||||
|
||||
@@ -591,9 +591,7 @@ gtk_color_button_clicked (GtkButton *b)
|
||||
|
||||
gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (priv->cs_dialog), &priv->rgba);
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
gtk_window_present (GTK_WINDOW (priv->cs_dialog));
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#define GDK_DISABLE_DEPRECATION_WARNINGS
|
||||
#include "gtkcontainer.h"
|
||||
#include "gtkcontainerprivate.h"
|
||||
|
||||
|
||||
@@ -6388,7 +6388,7 @@ gtk_entry_create_layout (GtkEntry *entry,
|
||||
PangoDirection pango_dir;
|
||||
|
||||
if (gtk_entry_get_display_mode (entry) == DISPLAY_NORMAL)
|
||||
pango_dir = _gtk_pango_find_base_dir (display_text, n_bytes);
|
||||
pango_dir = pango_find_base_dir (display_text, n_bytes);
|
||||
else
|
||||
pango_dir = PANGO_DIRECTION_NEUTRAL;
|
||||
|
||||
|
||||
@@ -2738,11 +2738,7 @@ open_dialog (GtkFileChooserButton *button)
|
||||
|
||||
gtk_widget_set_sensitive (priv->combo_box, FALSE);
|
||||
if (priv->dialog)
|
||||
{
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
gtk_window_present (GTK_WINDOW (priv->dialog));
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
}
|
||||
gtk_window_present (GTK_WINDOW (priv->dialog));
|
||||
else
|
||||
gtk_native_dialog_show (GTK_NATIVE_DIALOG (priv->native));
|
||||
}
|
||||
|
||||
@@ -653,9 +653,7 @@ show_dialog (GtkFileChooserNative *self)
|
||||
G_CALLBACK (dialog_update_preview_cb),
|
||||
self);
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
gtk_window_present (GTK_WINDOW (self->dialog));
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -1152,9 +1152,7 @@ gtk_font_button_clicked (GtkButton *button)
|
||||
gtk_font_chooser_set_font_desc (font_dialog, font_button->priv->font_desc);
|
||||
}
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
gtk_window_present (GTK_WINDOW (font_button->priv->font_dialog));
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -53,13 +53,10 @@
|
||||
#include "gtkcombobox.h"
|
||||
#include "gtkgesturemultipress.h"
|
||||
|
||||
#if defined(HAVE_HARFBUZZ) && defined(HAVE_PANGOFT)
|
||||
#include <pango/pangofc-font.h>
|
||||
#ifdef HAVE_HARFBUZZ
|
||||
#include <hb.h>
|
||||
#include <hb-ot.h>
|
||||
#include <hb-ft.h>
|
||||
#include <freetype/freetype.h>
|
||||
#include <freetype/ftmm.h>
|
||||
#include "language-names.h"
|
||||
#include "script-names.h"
|
||||
#endif
|
||||
@@ -862,7 +859,7 @@ gtk_font_chooser_widget_init (GtkFontChooserWidget *fontchooser)
|
||||
|
||||
/* Load data and set initial style-dependent parameters */
|
||||
gtk_font_chooser_widget_load_fonts (fontchooser, TRUE);
|
||||
#if defined(HAVE_HARFBUZZ) && defined(HAVE_PANGOFT)
|
||||
#ifdef HAVE_HARFBUZZ
|
||||
gtk_font_chooser_widget_populate_features (fontchooser);
|
||||
#endif
|
||||
gtk_font_chooser_widget_set_cell_size (fontchooser);
|
||||
@@ -1442,7 +1439,7 @@ gtk_font_chooser_widget_ensure_selection (GtkFontChooserWidget *fontchooser)
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(HAVE_HARFBUZZ) && defined(HAVE_PANGOFT)
|
||||
#ifdef HAVE_HARFBUZZ
|
||||
|
||||
/* OpenType variations */
|
||||
|
||||
@@ -1501,69 +1498,139 @@ adjustment_changed (GtkAdjustment *adjustment,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
should_show_axis (FT_Var_Axis *ax)
|
||||
should_show_axis (hb_ot_var_axis_info_t *hb_axis)
|
||||
{
|
||||
/* FIXME use FT_Get_Var_Axis_Flags */
|
||||
if (ax->tag == FT_MAKE_TAG ('o', 'p', 's', 'z'))
|
||||
if (hb_axis->tag == HB_OT_TAG_VAR_AXIS_OPTICAL_SIZE)
|
||||
return FALSE;
|
||||
|
||||
if ((hb_axis->flags & HB_OT_VAR_AXIS_FLAG_HIDDEN) != 0)
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#if 0
|
||||
static gboolean
|
||||
is_named_instance (FT_Face face)
|
||||
is_named_instance (hb_font_t *hb_font)
|
||||
{
|
||||
return (face->face_index >> 16) > 0;
|
||||
hb_face_t *hb_face;
|
||||
unsigned int n_axes;
|
||||
unsigned int n_instances;
|
||||
unsigned int len;
|
||||
int *coords;
|
||||
const int *coords1;
|
||||
float *design_coords;
|
||||
int *norm_coords;
|
||||
unsigned int instance;
|
||||
int i;
|
||||
|
||||
hb_face = hb_font_get_face (hb_font);
|
||||
n_axes = hb_ot_var_get_axis_count (hb_face);
|
||||
n_instances = hb_ot_var_get_named_instance_count (hb_face);
|
||||
if (n_instances == 0)
|
||||
return FALSE;
|
||||
|
||||
coords1 = hb_font_get_var_coords_normalized (hb_font, &len);
|
||||
coords = g_new0 (int, n_axes);
|
||||
for (i = 0; i < len; i++)
|
||||
coords[i] = coords1[i];
|
||||
|
||||
design_coords = g_new (float, n_axes);
|
||||
norm_coords = g_new (int, n_axes);
|
||||
for (instance = 0; instance < n_instances; instance++)
|
||||
{
|
||||
len = n_axes;
|
||||
hb_ot_var_named_instance_get_design_coords (hb_face, instance, &len, design_coords);
|
||||
hb_ot_var_normalize_coords (hb_face, len, design_coords, norm_coords);
|
||||
for (i = 0; i < n_axes; i++)
|
||||
{
|
||||
if (norm_coords[i] != coords[i])
|
||||
break;
|
||||
}
|
||||
if (i == n_axes)
|
||||
{
|
||||
g_free (coords);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
g_free (coords);
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
static struct {
|
||||
guint32 tag;
|
||||
const char *name;
|
||||
} axis_names[] = {
|
||||
{ FT_MAKE_TAG ('w', 'd', 't', 'h'), N_("Width") },
|
||||
{ FT_MAKE_TAG ('w', 'g', 'h', 't'), N_("Weight") },
|
||||
{ FT_MAKE_TAG ('i', 't', 'a', 'l'), N_("Italic") },
|
||||
{ FT_MAKE_TAG ('s', 'l', 'n', 't'), N_("Slant") },
|
||||
{ FT_MAKE_TAG ('o', 'p', 's', 'z'), N_("Optical Size") },
|
||||
{ HB_OT_TAG_VAR_AXIS_WIDTH, N_("Width") },
|
||||
{ HB_OT_TAG_VAR_AXIS_WEIGHT, N_("Weight") },
|
||||
{ HB_OT_TAG_VAR_AXIS_ITALIC, N_("Italic") },
|
||||
{ HB_OT_TAG_VAR_AXIS_SLANT, N_("Slant") },
|
||||
};
|
||||
|
||||
/* FIXME: this is missing harfbuzz api that needs to deal with AVAR */
|
||||
static double
|
||||
get_value (hb_ot_var_axis_info_t *hb_axis, int value)
|
||||
{
|
||||
double val;
|
||||
|
||||
val = value * 1.0 / (1 << 14);
|
||||
if (value < 0)
|
||||
return hb_axis->default_value + (hb_axis->default_value - hb_axis->min_value) * val;
|
||||
else
|
||||
return hb_axis->default_value + (hb_axis->max_value - hb_axis->default_value) * val;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
add_axis (GtkFontChooserWidget *fontchooser,
|
||||
FT_Face face,
|
||||
FT_Var_Axis *ax,
|
||||
FT_Fixed value,
|
||||
int row)
|
||||
add_axis (GtkFontChooserWidget *fontchooser,
|
||||
hb_font_t *hb_font,
|
||||
hb_ot_var_axis_info_t *hb_axis,
|
||||
int value,
|
||||
int row)
|
||||
{
|
||||
GtkFontChooserWidgetPrivate *priv = fontchooser->priv;
|
||||
Axis *axis;
|
||||
const char *name;
|
||||
const char *name = NULL;
|
||||
char text[64];
|
||||
unsigned int len = 64;
|
||||
int i;
|
||||
double val;
|
||||
|
||||
axis = g_new (Axis, 1);
|
||||
axis->tag = ax->tag;
|
||||
axis->tag = hb_axis->tag;
|
||||
axis->fontchooser = GTK_WIDGET (fontchooser);
|
||||
|
||||
name = ax->name;
|
||||
for (i = 0; i < G_N_ELEMENTS (axis_names); i++)
|
||||
{
|
||||
if (axis_names[i].tag == ax->tag)
|
||||
if (axis_names[i].tag == hb_axis->tag)
|
||||
{
|
||||
name = _(axis_names[i].name);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (name == NULL)
|
||||
{
|
||||
hb_face_t *hb_face = hb_font_get_face (hb_font);
|
||||
hb_language_t language = hb_language_from_string ("en", -1);
|
||||
hb_ot_name_get_utf8 (hb_face, hb_axis->name_id, language, &len, text);
|
||||
name = text;
|
||||
}
|
||||
|
||||
axis->label = gtk_label_new (name);
|
||||
gtk_widget_show (axis->label);
|
||||
gtk_widget_set_halign (axis->label, GTK_ALIGN_START);
|
||||
gtk_widget_set_valign (axis->label, GTK_ALIGN_BASELINE);
|
||||
gtk_grid_attach (GTK_GRID (priv->axis_grid), axis->label, 0, row, 1, 1);
|
||||
axis->adjustment = gtk_adjustment_new ((double)FixedToFloat(value),
|
||||
(double)FixedToFloat(ax->minimum),
|
||||
(double)FixedToFloat(ax->maximum),
|
||||
val = get_value (hb_axis, value);
|
||||
axis->adjustment = gtk_adjustment_new (val,
|
||||
(double)hb_axis->min_value,
|
||||
(double)hb_axis->max_value,
|
||||
1.0, 10.0, 0.0);
|
||||
axis->scale = gtk_scale_new (GTK_ORIENTATION_HORIZONTAL, axis->adjustment);
|
||||
gtk_widget_show (axis->scale);
|
||||
gtk_scale_add_mark (GTK_SCALE (axis->scale), (double)FixedToFloat(ax->def), GTK_POS_TOP, NULL);
|
||||
gtk_scale_add_mark (GTK_SCALE (axis->scale), (double)hb_axis->default_value, GTK_POS_TOP, NULL);
|
||||
gtk_widget_set_valign (axis->scale, GTK_ALIGN_BASELINE);
|
||||
gtk_widget_set_hexpand (axis->scale, TRUE);
|
||||
gtk_widget_set_size_request (axis->scale, 100, -1);
|
||||
@@ -1579,7 +1646,8 @@ add_axis (GtkFontChooserWidget *fontchooser,
|
||||
|
||||
adjustment_changed (axis->adjustment, axis);
|
||||
g_signal_connect (axis->adjustment, "value-changed", G_CALLBACK (adjustment_changed), axis);
|
||||
if (is_named_instance (face) || !should_show_axis (ax))
|
||||
|
||||
if (/* is_named_instance (hb_font) || */ !should_show_axis (hb_axis))
|
||||
{
|
||||
gtk_widget_hide (axis->label);
|
||||
gtk_widget_hide (axis->scale);
|
||||
@@ -1596,10 +1664,15 @@ gtk_font_chooser_widget_update_font_variations (GtkFontChooserWidget *fontchoose
|
||||
{
|
||||
GtkFontChooserWidgetPrivate *priv = fontchooser->priv;
|
||||
PangoFont *pango_font;
|
||||
FT_Face ft_face;
|
||||
FT_MM_Var *ft_mm_var;
|
||||
FT_Error ret;
|
||||
hb_font_t *hb_font;
|
||||
hb_face_t *hb_face;
|
||||
unsigned int n_axes;
|
||||
hb_ot_var_axis_info_t *axes;
|
||||
const int *coords;
|
||||
unsigned int len;
|
||||
int i;
|
||||
gboolean has_axis = FALSE;
|
||||
PangoFontFace *face;
|
||||
|
||||
if (priv->updating_variations)
|
||||
return FALSE;
|
||||
@@ -1612,39 +1685,21 @@ gtk_font_chooser_widget_update_font_variations (GtkFontChooserWidget *fontchoose
|
||||
|
||||
pango_font = pango_context_load_font (gtk_widget_get_pango_context (GTK_WIDGET (fontchooser)),
|
||||
priv->font_desc);
|
||||
ft_face = pango_fc_font_lock_face (PANGO_FC_FONT (pango_font));
|
||||
face = gtk_font_chooser_widget_get_face (GTK_FONT_CHOOSER (fontchooser));
|
||||
if (pango_font_face_is_synthesized (face))
|
||||
return FALSE;
|
||||
|
||||
ret = FT_Get_MM_Var (ft_face, &ft_mm_var);
|
||||
if (ret == 0)
|
||||
hb_font = pango_font_get_hb_font (pango_font);
|
||||
hb_face = hb_font_get_face (hb_font);
|
||||
n_axes = hb_ot_var_get_axis_count (hb_face);
|
||||
axes = g_new (hb_ot_var_axis_info_t, n_axes);
|
||||
hb_ot_var_get_axis_infos (hb_face, 0, &n_axes, axes);
|
||||
coords = hb_font_get_var_coords_normalized (hb_font, &len);
|
||||
for (i = 0; i < n_axes; i++)
|
||||
{
|
||||
int i;
|
||||
FT_Fixed *coords;
|
||||
|
||||
coords = g_new (FT_Fixed, ft_mm_var->num_axis);
|
||||
for (i = 0; i < ft_mm_var->num_axis; i++)
|
||||
coords[i] = ft_mm_var->axis[i].def;
|
||||
|
||||
if (ft_face->face_index > 0)
|
||||
{
|
||||
int instance_id = ft_face->face_index >> 16;
|
||||
if (instance_id && instance_id <= ft_mm_var->num_namedstyles)
|
||||
{
|
||||
FT_Var_Named_Style *instance = &ft_mm_var->namedstyle[instance_id - 1];
|
||||
memcpy (coords, instance->coords, ft_mm_var->num_axis * sizeof (*coords));
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < ft_mm_var->num_axis; i++)
|
||||
{
|
||||
if (add_axis (fontchooser, ft_face, &ft_mm_var->axis[i], coords[i], i + 4))
|
||||
has_axis = TRUE;
|
||||
}
|
||||
|
||||
g_free (coords);
|
||||
free (ft_mm_var);
|
||||
if (add_axis (fontchooser, hb_font, &axes[i], i < len ? coords[i] : 0, i + 4))
|
||||
has_axis = TRUE;
|
||||
}
|
||||
|
||||
pango_fc_font_unlock_face (PANGO_FC_FONT (pango_font));
|
||||
g_object_unref (pango_font);
|
||||
|
||||
return has_axis;
|
||||
@@ -1787,7 +1842,7 @@ find_affected_text (hb_tag_t feature_tag,
|
||||
chars = g_string_new ("");
|
||||
|
||||
hb_ot_layout_table_find_script (hb_face, HB_OT_TAG_GSUB, script_tag, &script_index);
|
||||
hb_ot_layout_script_find_language (hb_face, HB_OT_TAG_GSUB, script_index, lang_tag, &lang_index);
|
||||
hb_ot_layout_script_select_language (hb_face, HB_OT_TAG_GSUB, script_index, 1, &lang_tag, &lang_index);
|
||||
if (hb_ot_layout_language_find_feature (hb_face, HB_OT_TAG_GSUB, script_index, lang_index, feature_tag, &feature_index))
|
||||
{
|
||||
unsigned int lookup_indexes[32];
|
||||
@@ -2123,8 +2178,8 @@ gtk_font_chooser_widget_update_font_features (GtkFontChooserWidget *fontchooser)
|
||||
{
|
||||
GtkFontChooserWidgetPrivate *priv = fontchooser->priv;
|
||||
PangoFont *pango_font;
|
||||
FT_Face ft_face;
|
||||
hb_font_t *hb_font;
|
||||
hb_face_t *hb_face;
|
||||
hb_tag_t script_tag;
|
||||
hb_tag_t lang_tag;
|
||||
guint script_index = 0;
|
||||
@@ -2132,6 +2187,10 @@ gtk_font_chooser_widget_update_font_features (GtkFontChooserWidget *fontchooser)
|
||||
int i, j;
|
||||
GList *l;
|
||||
gboolean has_feature = FALSE;
|
||||
hb_tag_t table[2] = { HB_OT_TAG_GSUB, HB_OT_TAG_GPOS };
|
||||
hb_tag_t features[80];
|
||||
unsigned int count;
|
||||
unsigned int n_features;
|
||||
|
||||
for (l = priv->feature_items; l; l = l->next)
|
||||
{
|
||||
@@ -2145,67 +2204,47 @@ gtk_font_chooser_widget_update_font_features (GtkFontChooserWidget *fontchooser)
|
||||
|
||||
pango_font = pango_context_load_font (gtk_widget_get_pango_context (GTK_WIDGET (fontchooser)),
|
||||
priv->font_desc);
|
||||
ft_face = pango_fc_font_lock_face (PANGO_FC_FONT (pango_font)),
|
||||
hb_font = hb_ft_font_create (ft_face, NULL);
|
||||
hb_font = pango_font_get_hb_font (pango_font);
|
||||
hb_face = hb_font_get_face (hb_font);
|
||||
|
||||
if (hb_font)
|
||||
find_language_and_script (fontchooser, hb_face, &lang_tag, &script_tag);
|
||||
|
||||
n_features = 0;
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
hb_tag_t table[2] = { HB_OT_TAG_GSUB, HB_OT_TAG_GPOS };
|
||||
hb_face_t *hb_face;
|
||||
hb_tag_t features[80];
|
||||
unsigned int count;
|
||||
unsigned int n_features;
|
||||
|
||||
hb_face = hb_font_get_face (hb_font);
|
||||
|
||||
find_language_and_script (fontchooser, hb_face, &lang_tag, &script_tag);
|
||||
|
||||
n_features = 0;
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
hb_ot_layout_table_find_script (hb_face, table[i], script_tag, &script_index);
|
||||
hb_ot_layout_script_find_language (hb_face, table[i], script_index, lang_tag, &lang_index);
|
||||
count = G_N_ELEMENTS (features);
|
||||
hb_ot_layout_language_get_feature_tags (hb_face,
|
||||
table[i],
|
||||
script_index,
|
||||
lang_index,
|
||||
n_features,
|
||||
&count,
|
||||
features);
|
||||
n_features += count;
|
||||
}
|
||||
|
||||
for (j = 0; j < n_features; j++)
|
||||
{
|
||||
for (l = priv->feature_items; l; l = l->next)
|
||||
{
|
||||
FeatureItem *item = l->data;
|
||||
if (item->tag != features[j])
|
||||
continue;
|
||||
|
||||
has_feature = TRUE;
|
||||
gtk_widget_show (item->top);
|
||||
gtk_widget_show (gtk_widget_get_parent (item->top));
|
||||
|
||||
update_feature_example (item, hb_face, script_tag, lang_tag, priv->font_desc);
|
||||
|
||||
if (GTK_IS_RADIO_BUTTON (item->feat))
|
||||
{
|
||||
GtkWidget *def = GTK_WIDGET (g_object_get_data (G_OBJECT (item->feat), "default"));
|
||||
gtk_widget_show (gtk_widget_get_parent (def));
|
||||
}
|
||||
else if (GTK_IS_CHECK_BUTTON (item->feat))
|
||||
{
|
||||
set_inconsistent (GTK_CHECK_BUTTON (item->feat), TRUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
hb_face_destroy (hb_face);
|
||||
hb_ot_layout_table_find_script (hb_face, table[i], script_tag, &script_index);
|
||||
hb_ot_layout_script_select_language (hb_face, table[i], script_index, 1, &lang_tag, &lang_index);
|
||||
count = G_N_ELEMENTS (features);
|
||||
hb_ot_layout_language_get_feature_tags (hb_face, table[i], script_index, lang_index, n_features, &count, features);
|
||||
n_features += count;
|
||||
}
|
||||
|
||||
for (j = 0; j < n_features; j++)
|
||||
{
|
||||
for (l = priv->feature_items; l; l = l->next)
|
||||
{
|
||||
FeatureItem *item = l->data;
|
||||
if (item->tag != features[j])
|
||||
continue;
|
||||
|
||||
has_feature = TRUE;
|
||||
gtk_widget_show (item->top);
|
||||
gtk_widget_show (gtk_widget_get_parent (item->top));
|
||||
|
||||
update_feature_example (item, hb_face, script_tag, lang_tag, priv->font_desc);
|
||||
|
||||
if (GTK_IS_RADIO_BUTTON (item->feat))
|
||||
{
|
||||
GtkWidget *def = GTK_WIDGET (g_object_get_data (G_OBJECT (item->feat), "default"));
|
||||
gtk_widget_show (gtk_widget_get_parent (def));
|
||||
}
|
||||
else if (GTK_IS_CHECK_BUTTON (item->feat))
|
||||
{
|
||||
set_inconsistent (GTK_CHECK_BUTTON (item->feat), TRUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pango_fc_font_unlock_face (PANGO_FC_FONT (pango_font));
|
||||
g_object_unref (pango_font);
|
||||
|
||||
return has_feature;
|
||||
@@ -2258,7 +2297,7 @@ update_font_features (GtkFontChooserWidget *fontchooser)
|
||||
gtk_font_chooser_widget_update_preview_attributes (fontchooser);
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif /* HAVE_HARFBUZ */
|
||||
|
||||
static void
|
||||
gtk_font_chooser_widget_merge_font_desc (GtkFontChooserWidget *fontchooser,
|
||||
@@ -2305,7 +2344,7 @@ gtk_font_chooser_widget_merge_font_desc (GtkFontChooserWidget *fontchooser
|
||||
|
||||
gtk_font_chooser_widget_update_marks (fontchooser);
|
||||
|
||||
#if defined(HAVE_HARFBUZZ) && defined(HAVE_PANGOFT)
|
||||
#ifdef HAVE_HARFBUZZ
|
||||
if (gtk_font_chooser_widget_update_font_features (fontchooser))
|
||||
has_tweak = TRUE;
|
||||
if (gtk_font_chooser_widget_update_font_variations (fontchooser))
|
||||
|
||||
@@ -1398,18 +1398,13 @@ moved_to_rect_cb (GdkWindow *window,
|
||||
gboolean flipped_y,
|
||||
GtkMenu *menu)
|
||||
{
|
||||
GtkMenuPrivate *priv = menu->priv;
|
||||
|
||||
gtk_window_fixate_size (GTK_WINDOW (priv->toplevel));
|
||||
|
||||
if (!priv->emulated_move_to_rect)
|
||||
g_signal_emit (menu,
|
||||
menu_signals[POPPED_UP],
|
||||
0,
|
||||
flipped_rect,
|
||||
final_rect,
|
||||
flipped_x,
|
||||
flipped_y);
|
||||
g_signal_emit (menu,
|
||||
menu_signals[POPPED_UP],
|
||||
0,
|
||||
flipped_rect,
|
||||
final_rect,
|
||||
flipped_x,
|
||||
flipped_y);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -2681,7 +2676,7 @@ gtk_menu_set_accel_group (GtkMenu *menu,
|
||||
GtkMenuPrivate *priv;
|
||||
|
||||
g_return_if_fail (GTK_IS_MENU (menu));
|
||||
g_return_if_fail (!accel_group || GTK_IS_ACCEL_GROUP (accel_group));
|
||||
g_return_if_fail (GTK_IS_ACCEL_GROUP (accel_group));
|
||||
|
||||
priv = menu->priv;
|
||||
|
||||
@@ -2822,7 +2817,7 @@ _gtk_menu_refresh_accel_paths (GtkMenu *menu,
|
||||
{
|
||||
GtkMenuPrivate *priv = menu->priv;
|
||||
|
||||
if (priv->accel_path)
|
||||
if (priv->accel_path && priv->accel_group)
|
||||
{
|
||||
AccelPropagation prop;
|
||||
|
||||
@@ -5272,7 +5267,6 @@ gtk_menu_position (GtkMenu *menu,
|
||||
* the right place to popup the menu.
|
||||
*/
|
||||
gtk_widget_realize (priv->toplevel);
|
||||
gtk_window_move_resize (GTK_WINDOW (priv->toplevel));
|
||||
|
||||
if (!gtk_widget_get_visible (priv->toplevel))
|
||||
gtk_window_set_type_hint (GTK_WINDOW (priv->toplevel), priv->menu_type_hint);
|
||||
@@ -5292,9 +5286,9 @@ gtk_menu_position (GtkMenu *menu,
|
||||
|
||||
g_signal_handlers_disconnect_by_func (toplevel, moved_to_rect_cb, menu);
|
||||
|
||||
g_signal_connect (toplevel, "moved-to-rect", G_CALLBACK (moved_to_rect_cb),
|
||||
menu);
|
||||
priv->emulated_move_to_rect = emulated_move_to_rect;
|
||||
if (!emulated_move_to_rect)
|
||||
g_signal_connect (toplevel, "moved-to-rect", G_CALLBACK (moved_to_rect_cb),
|
||||
menu);
|
||||
|
||||
gdk_window_move_to_rect (toplevel,
|
||||
&rect,
|
||||
@@ -5398,7 +5392,7 @@ gtk_menu_scroll_to (GtkMenu *menu,
|
||||
if (!priv->upper_arrow_visible || !priv->lower_arrow_visible)
|
||||
gtk_widget_queue_draw (GTK_WIDGET (menu));
|
||||
|
||||
if (!priv->upper_arrow_visible &&
|
||||
if (!priv->upper_arrow_visible &
|
||||
flags & GTK_MENU_SCROLL_FLAG_ADAPT)
|
||||
should_offset_by_arrow = TRUE;
|
||||
else
|
||||
|
||||
@@ -62,7 +62,6 @@ struct _GtkMenuPrivate
|
||||
gint rect_anchor_dx;
|
||||
gint rect_anchor_dy;
|
||||
GdkWindowTypeHint menu_type_hint;
|
||||
gboolean emulated_move_to_rect;
|
||||
|
||||
guint toggle_size;
|
||||
guint accel_size;
|
||||
|
||||
@@ -793,9 +793,7 @@ paper_size_changed (GtkComboBox *combo_box,
|
||||
/* And show the custom paper dialog */
|
||||
custom_paper_dialog = _gtk_custom_paper_unix_dialog_new (GTK_WINDOW (dialog), NULL);
|
||||
g_signal_connect (custom_paper_dialog, "response", G_CALLBACK (custom_paper_dialog_response_cb), dialog);
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
gtk_window_present (GTK_WINDOW (custom_paper_dialog));
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
#include "config.h"
|
||||
#include "gtkpango.h"
|
||||
#include <pango/pangocairo.h>
|
||||
#include <fribidi.h>
|
||||
#include "gtkintl.h"
|
||||
|
||||
#define GTK_TYPE_FILL_LAYOUT_RENDERER (_gtk_fill_layout_renderer_get_type())
|
||||
@@ -1322,46 +1321,3 @@ _gtk_pango_attr_list_merge (PangoAttrList *into,
|
||||
|
||||
return into;
|
||||
}
|
||||
|
||||
PangoDirection
|
||||
_gtk_pango_unichar_direction (gunichar ch)
|
||||
{
|
||||
FriBidiCharType fribidi_ch_type;
|
||||
|
||||
G_STATIC_ASSERT (sizeof (FriBidiChar) == sizeof (gunichar));
|
||||
|
||||
fribidi_ch_type = fribidi_get_bidi_type (ch);
|
||||
|
||||
if (!FRIBIDI_IS_STRONG (fribidi_ch_type))
|
||||
return PANGO_DIRECTION_NEUTRAL;
|
||||
else if (FRIBIDI_IS_RTL (fribidi_ch_type))
|
||||
return PANGO_DIRECTION_RTL;
|
||||
else
|
||||
return PANGO_DIRECTION_LTR;
|
||||
}
|
||||
|
||||
PangoDirection
|
||||
_gtk_pango_find_base_dir (const gchar *text,
|
||||
gint length)
|
||||
{
|
||||
PangoDirection dir = PANGO_DIRECTION_NEUTRAL;
|
||||
const gchar *p;
|
||||
|
||||
g_return_val_if_fail (text != NULL || length == 0, PANGO_DIRECTION_NEUTRAL);
|
||||
|
||||
p = text;
|
||||
while ((length < 0 || p < text + length) && *p)
|
||||
{
|
||||
gunichar wc = g_utf8_get_char (p);
|
||||
|
||||
dir = _gtk_pango_unichar_direction (wc);
|
||||
|
||||
if (dir != PANGO_DIRECTION_NEUTRAL)
|
||||
break;
|
||||
|
||||
p = g_utf8_next_char (p);
|
||||
}
|
||||
|
||||
return dir;
|
||||
}
|
||||
|
||||
|
||||
@@ -82,9 +82,6 @@ gchar *_gtk_pango_get_text_after (PangoLayout *layout,
|
||||
PangoAttrList *_gtk_pango_attr_list_merge (PangoAttrList *into,
|
||||
PangoAttrList *from);
|
||||
|
||||
PangoDirection _gtk_pango_find_base_dir (const gchar *text,
|
||||
gint length);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GTK_PANGO_H__ */
|
||||
|
||||
@@ -1184,14 +1184,12 @@ gtk_popover_draw (GtkWidget *widget,
|
||||
gap_end = final_y - rect_y;
|
||||
}
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
/* Now render the frame, without the gap for the arrow tip */
|
||||
gtk_render_frame_gap (context, cr,
|
||||
rect_x, rect_y,
|
||||
rect_w, rect_h,
|
||||
gap_side,
|
||||
gap_start, gap_end);
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -573,9 +573,7 @@ filesave_choose_cb (GtkWidget *button,
|
||||
g_signal_connect (dialog, "response",
|
||||
G_CALLBACK (dialog_response_callback), widget);
|
||||
gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
gtk_window_present (GTK_WINDOW (dialog));
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
}
|
||||
|
||||
static gchar *
|
||||
|
||||
@@ -735,10 +735,8 @@ gtk_print_operation_unix_run_dialog_async (GtkPrintOperation *op,
|
||||
|
||||
g_signal_connect (pd, "response",
|
||||
G_CALLBACK (handle_print_response), rdata);
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
|
||||
gtk_window_present (GTK_WINDOW (pd));
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1040,10 +1038,8 @@ gtk_print_run_page_setup_dialog_async (GtkWindow *parent,
|
||||
|
||||
g_signal_connect (dialog, "response",
|
||||
G_CALLBACK (handle_page_setup_response), rdata);
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
|
||||
gtk_window_present (GTK_WINDOW (dialog));
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
}
|
||||
|
||||
struct _PrinterFinder
|
||||
|
||||
@@ -2955,9 +2955,7 @@ handle_progress_response (GtkWidget *dialog,
|
||||
static gboolean
|
||||
show_progress_timeout (PrintPagesData *data)
|
||||
{
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
gtk_window_present (GTK_WINDOW (data->progress));
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
|
||||
data->op->priv->show_progress_timeout_id = 0;
|
||||
|
||||
|
||||
@@ -3335,9 +3335,7 @@ paper_size_changed (GtkComboBox *combo_box,
|
||||
/* And show the custom paper dialog */
|
||||
custom_paper_dialog = _gtk_custom_paper_unix_dialog_new (GTK_WINDOW (dialog), _("Manage Custom Sizes"));
|
||||
g_signal_connect (custom_paper_dialog, "response", G_CALLBACK (custom_paper_dialog_response_cb), dialog);
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
gtk_window_present (GTK_WINDOW (custom_paper_dialog));
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2854,7 +2854,7 @@ gtk_scrolled_window_finalize (GObject *object)
|
||||
g_clear_object (&priv->long_press_gesture);
|
||||
g_clear_object (&priv->pan_gesture);
|
||||
g_clear_object (&priv->gadget);
|
||||
g_clear_pointer (&priv->scroll_history, g_array_unref);
|
||||
g_clear_pointer (&priv->scroll_history, (GDestroyNotify) g_array_unref);
|
||||
|
||||
G_OBJECT_CLASS (gtk_scrolled_window_parent_class)->finalize (object);
|
||||
}
|
||||
@@ -3690,7 +3690,7 @@ scrolled_window_deceleration_cb (GtkWidget *widget,
|
||||
gtk_adjustment_set_value (hadjustment, position);
|
||||
}
|
||||
else if (data->hscrolling)
|
||||
g_clear_pointer (&data->hscrolling, gtk_kinetic_scrolling_free);
|
||||
g_clear_pointer (&data->hscrolling, (GDestroyNotify) gtk_kinetic_scrolling_free);
|
||||
|
||||
if (data->vscrolling &&
|
||||
gtk_kinetic_scrolling_tick (data->vscrolling, elapsed, &position))
|
||||
@@ -3699,7 +3699,7 @@ scrolled_window_deceleration_cb (GtkWidget *widget,
|
||||
gtk_adjustment_set_value (vadjustment, position);
|
||||
}
|
||||
else if (data->vscrolling)
|
||||
g_clear_pointer (&data->vscrolling, gtk_kinetic_scrolling_free);
|
||||
g_clear_pointer (&data->vscrolling, (GDestroyNotify) gtk_kinetic_scrolling_free);
|
||||
|
||||
if (!data->hscrolling && !data->vscrolling)
|
||||
{
|
||||
|
||||
@@ -88,10 +88,6 @@ G_DEFINE_TYPE_WITH_PRIVATE (GtkSearchEngineQuartz, _gtk_search_engine_quartz, GT
|
||||
GtkSearchHit *hit;
|
||||
|
||||
result_path = [[result valueForAttribute:@"kMDItemPath"] UTF8String];
|
||||
|
||||
if (result_path == NULL)
|
||||
continue;
|
||||
|
||||
file = g_file_new_for_path (result_path);
|
||||
|
||||
hit = g_new (GtkSearchHit, 1);
|
||||
@@ -196,8 +192,6 @@ gtk_search_engine_quartz_set_query (GtkSearchEngine *engine,
|
||||
GtkQuery *query)
|
||||
{
|
||||
GtkSearchEngineQuartz *quartz;
|
||||
const char* path = NULL;
|
||||
GFile *location = NULL;
|
||||
|
||||
QUARTZ_POOL_ALLOC;
|
||||
|
||||
@@ -210,28 +204,11 @@ gtk_search_engine_quartz_set_query (GtkSearchEngine *engine,
|
||||
g_object_unref (quartz->priv->query);
|
||||
|
||||
quartz->priv->query = query;
|
||||
location = gtk_query_get_location (query);
|
||||
|
||||
if (location)
|
||||
path = g_file_peek_path (location);
|
||||
|
||||
/* We create a query to look for ".*text.*" in the text contents of
|
||||
* all indexed files. (Should we also search for text in file and folder
|
||||
* names?).
|
||||
*/
|
||||
|
||||
if (path)
|
||||
{
|
||||
NSString *ns_path = [[NSString string] initWithUTF8String:path];
|
||||
[quartz->priv->ns_query setSearchScopes:@[ns_path]];
|
||||
}
|
||||
else
|
||||
{
|
||||
[quartz->priv->ns_query setSearchScopes:@[NSMetadataQueryLocalComputerScope]];
|
||||
}
|
||||
|
||||
[quartz->priv->ns_query setSearchItems:@[(NSString*)kMDItemTextContent,
|
||||
(NSString*)kMDItemFSName]];
|
||||
[quartz->priv->ns_query setPredicate:
|
||||
[NSPredicate predicateWithFormat:
|
||||
[NSString stringWithFormat:@"(kMDItemTextContent LIKE[cd] \"*%s*\")",
|
||||
|
||||
@@ -449,8 +449,7 @@ gtk_switch_allocate_contents (GtkCssGadget *gadget,
|
||||
GtkSwitch *self = GTK_SWITCH (gtk_css_gadget_get_owner (gadget));
|
||||
GtkSwitchPrivate *priv = self->priv;
|
||||
GtkAllocation child_alloc;
|
||||
GtkAllocation on_clip, off_clip;
|
||||
|
||||
|
||||
child_alloc.x = allocation->x + round (priv->handle_pos * (allocation->width - allocation->width / 2));
|
||||
child_alloc.y = allocation->y;
|
||||
child_alloc.width = allocation->width / 2;
|
||||
@@ -466,17 +465,13 @@ gtk_switch_allocate_contents (GtkCssGadget *gadget,
|
||||
gtk_css_gadget_allocate (priv->on_gadget,
|
||||
&child_alloc,
|
||||
baseline,
|
||||
&on_clip);
|
||||
|
||||
gdk_rectangle_union (out_clip, &on_clip, out_clip);
|
||||
out_clip);
|
||||
|
||||
child_alloc.x = allocation->x + allocation->width - child_alloc.width;
|
||||
gtk_css_gadget_allocate (priv->off_gadget,
|
||||
&child_alloc,
|
||||
baseline,
|
||||
&off_clip);
|
||||
|
||||
gdk_rectangle_union (out_clip, &off_clip, out_clip);
|
||||
out_clip);
|
||||
|
||||
if (gtk_widget_get_realized (GTK_WIDGET (self)))
|
||||
{
|
||||
|
||||
@@ -67,7 +67,6 @@
|
||||
#include "gtkdebug.h"
|
||||
#include "gtktextmarkprivate.h"
|
||||
#include "gtktextsegment.h"
|
||||
#include "gtkpango.h"
|
||||
|
||||
/*
|
||||
* Types
|
||||
@@ -599,7 +598,8 @@ gtk_text_btree_resolve_bidi (GtkTextIter *start,
|
||||
{
|
||||
PangoDirection pango_dir;
|
||||
|
||||
pango_dir = _gtk_pango_find_base_dir (seg->body.chars, seg->byte_count);
|
||||
pango_dir = pango_find_base_dir (seg->body.chars,
|
||||
seg->byte_count);
|
||||
|
||||
if (pango_dir != PANGO_DIRECTION_NEUTRAL)
|
||||
{
|
||||
|
||||
@@ -58,7 +58,6 @@
|
||||
#include "gtkpixelcacheprivate.h"
|
||||
#include "gtkmagnifierprivate.h"
|
||||
#include "gtkemojichooser.h"
|
||||
#include "gtkpango.h"
|
||||
|
||||
#include "a11y/gtktextviewaccessibleprivate.h"
|
||||
|
||||
@@ -6461,7 +6460,7 @@ iter_line_is_rtl (const GtkTextIter *iter)
|
||||
gtk_text_iter_set_line_offset (&start, 0);
|
||||
gtk_text_iter_forward_line (&end);
|
||||
text = gtk_text_iter_get_visible_text (&start, &end);
|
||||
direction = _gtk_pango_find_base_dir (text, -1);
|
||||
direction = pango_find_base_dir (text, -1);
|
||||
|
||||
g_free (text);
|
||||
|
||||
|
||||
@@ -6395,8 +6395,6 @@ validate_row (GtkTreeView *tree_view,
|
||||
if (is_separator)
|
||||
{
|
||||
height = get_separator_height (tree_view);
|
||||
/* gtk_tree_view_get_row_height() assumes separator nodes are > 0 */
|
||||
height = MAX (height, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -16426,7 +16424,6 @@ gtk_tree_view_set_tooltip_query_cb (GtkWidget *widget,
|
||||
GtkTreePath *path;
|
||||
GtkTreeModel *model;
|
||||
GtkTreeView *tree_view = GTK_TREE_VIEW (widget);
|
||||
const char *transformed_str = NULL;
|
||||
|
||||
if (!gtk_tree_view_get_tooltip_context (GTK_TREE_VIEW (widget),
|
||||
&x, &y,
|
||||
@@ -16449,8 +16446,7 @@ gtk_tree_view_set_tooltip_query_cb (GtkWidget *widget,
|
||||
|
||||
g_value_unset (&value);
|
||||
|
||||
transformed_str = g_value_get_string (&transformed);
|
||||
if (transformed_str == NULL || *transformed_str == '\0')
|
||||
if (!g_value_get_string (&transformed))
|
||||
{
|
||||
g_value_unset (&transformed);
|
||||
gtk_tree_path_free (path);
|
||||
@@ -16458,7 +16454,7 @@ gtk_tree_view_set_tooltip_query_cb (GtkWidget *widget,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gtk_tooltip_set_markup (tooltip, transformed_str);
|
||||
gtk_tooltip_set_markup (tooltip, g_value_get_string (&transformed));
|
||||
gtk_tree_view_set_tooltip_row (tree_view, tooltip, path);
|
||||
|
||||
gtk_tree_path_free (path);
|
||||
|
||||
@@ -265,7 +265,6 @@ struct _GtkWindowPrivate
|
||||
guint unlimited_guessed_size_x : 1;
|
||||
guint unlimited_guessed_size_y : 1;
|
||||
guint force_resize : 1;
|
||||
guint fixate_size : 1;
|
||||
|
||||
guint use_subsurface : 1;
|
||||
|
||||
@@ -474,6 +473,7 @@ static GdkScreen *gtk_window_check_screen (GtkWindow *window);
|
||||
static GtkWindowGeometryInfo* gtk_window_get_geometry_info (GtkWindow *window,
|
||||
gboolean create);
|
||||
|
||||
static void gtk_window_move_resize (GtkWindow *window);
|
||||
static gboolean gtk_window_compare_hints (GdkGeometry *geometry_a,
|
||||
guint flags_a,
|
||||
GdkGeometry *geometry_b,
|
||||
@@ -551,10 +551,6 @@ static void gtk_window_style_updated (GtkWidget *widget);
|
||||
static void gtk_window_state_flags_changed (GtkWidget *widget,
|
||||
GtkStateFlags previous_state);
|
||||
|
||||
static void gtk_window_get_remembered_size (GtkWindow *window,
|
||||
int *width,
|
||||
int *height);
|
||||
|
||||
static GSList *toplevel_list = NULL;
|
||||
static guint window_signals[LAST_SIGNAL] = { 0 };
|
||||
static GList *default_icon_list = NULL;
|
||||
@@ -6440,8 +6436,6 @@ gtk_window_unmap (GtkWidget *widget)
|
||||
*/
|
||||
priv->need_default_position = TRUE;
|
||||
|
||||
priv->fixate_size = FALSE;
|
||||
|
||||
info = gtk_window_get_geometry_info (window, FALSE);
|
||||
if (info)
|
||||
{
|
||||
@@ -6483,14 +6477,6 @@ gtk_window_force_resize (GtkWindow *window)
|
||||
priv->force_resize = TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
gtk_window_fixate_size (GtkWindow *window)
|
||||
{
|
||||
GtkWindowPrivate *priv = window->priv;
|
||||
|
||||
priv->fixate_size = TRUE;
|
||||
}
|
||||
|
||||
/* (Note: Replace "size" with "width" or "height". Also, the request
|
||||
* mode is honoured.)
|
||||
* For selecting the default window size, the following conditions
|
||||
@@ -6522,13 +6508,6 @@ gtk_window_guess_default_size (GtkWindow *window,
|
||||
display = gtk_widget_get_display (widget);
|
||||
gdkwindow = _gtk_widget_get_window (widget);
|
||||
|
||||
if (window->priv->fixate_size)
|
||||
{
|
||||
g_assert (gdkwindow);
|
||||
gtk_window_get_remembered_size (window, width, height);
|
||||
return;
|
||||
}
|
||||
|
||||
if (gdkwindow)
|
||||
monitor = gdk_display_get_monitor_at_window (display, gdkwindow);
|
||||
else
|
||||
@@ -9750,7 +9729,7 @@ gtk_window_constrain_position (GtkWindow *window,
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
gtk_window_move_resize (GtkWindow *window)
|
||||
{
|
||||
/* Overview:
|
||||
@@ -10483,11 +10462,23 @@ gtk_window_draw (GtkWidget *widget,
|
||||
* gtk_window_present:
|
||||
* @window: a #GtkWindow
|
||||
*
|
||||
* Presents a window to the user. This function should not be used
|
||||
* as when it is called, it is too late to gather a valid timestamp
|
||||
* to allow focus stealing prevention to work correctly.
|
||||
* Presents a window to the user. This may mean raising the window
|
||||
* in the stacking order, deiconifying it, moving it to the current
|
||||
* desktop, and/or giving it the keyboard focus, possibly dependent
|
||||
* on the user’s platform, window manager, and preferences.
|
||||
*
|
||||
* Deprecated: 3.24: Use gtk_window_present_with_time() instead.
|
||||
* If @window is hidden, this function calls gtk_widget_show()
|
||||
* as well.
|
||||
*
|
||||
* This function should be used when the user tries to open a window
|
||||
* that’s already open. Say for example the preferences dialog is
|
||||
* currently open, and the user chooses Preferences from the menu
|
||||
* a second time; use gtk_window_present() to move the already-open dialog
|
||||
* where the user can see it.
|
||||
*
|
||||
* If you are calling this function in response to a user interaction,
|
||||
* it is preferable to use gtk_window_present_with_time().
|
||||
*
|
||||
**/
|
||||
void
|
||||
gtk_window_present (GtkWindow *window)
|
||||
@@ -10501,25 +10492,10 @@ gtk_window_present (GtkWindow *window)
|
||||
* @timestamp: the timestamp of the user interaction (typically a
|
||||
* button or key press event) which triggered this call
|
||||
*
|
||||
* Presents a window to the user. This may mean raising the window
|
||||
* in the stacking order, deiconifying it, moving it to the current
|
||||
* desktop, and/or giving it the keyboard focus, possibly dependent
|
||||
* on the user’s platform, window manager, and preferences.
|
||||
*
|
||||
* If @window is hidden, this function calls gtk_widget_show()
|
||||
* as well.
|
||||
*
|
||||
* This function should be used when the user tries to open a window
|
||||
* that’s already open. Say for example the preferences dialog is
|
||||
* currently open, and the user chooses Preferences from the menu
|
||||
* a second time; use gtk_window_present() to move the already-open dialog
|
||||
* where the user can see it.
|
||||
*
|
||||
* Presents a window to the user in response to a user interaction. The
|
||||
* timestamp should be gathered when the window was requested to be shown
|
||||
* (when clicking a link for example), rather than once the window is
|
||||
* ready to be shown.
|
||||
*
|
||||
* Presents a window to the user in response to a user interaction.
|
||||
* If you need to present a window without a timestamp, use
|
||||
* gtk_window_present(). See gtk_window_present() for details.
|
||||
*
|
||||
* Since: 2.8
|
||||
**/
|
||||
void
|
||||
@@ -10529,7 +10505,6 @@ gtk_window_present_with_time (GtkWindow *window,
|
||||
GtkWindowPrivate *priv;
|
||||
GtkWidget *widget;
|
||||
GdkWindow *gdk_window;
|
||||
static gsize warned_current_time = FALSE;
|
||||
|
||||
g_return_if_fail (GTK_IS_WINDOW (window));
|
||||
|
||||
@@ -10547,15 +10522,6 @@ gtk_window_present_with_time (GtkWindow *window,
|
||||
/* Translate a timestamp of GDK_CURRENT_TIME appropriately */
|
||||
if (timestamp == GDK_CURRENT_TIME)
|
||||
{
|
||||
if (g_once_init_enter (&warned_current_time))
|
||||
{
|
||||
gboolean warned = TRUE;
|
||||
g_warning ("gtk_window_present_with_time() should not be called with 0, or "
|
||||
"GDK_CURRENT_TIME as a timestamp, the timestamp should instead be "
|
||||
"gathered at the time the user initiated the request for the window "
|
||||
"to be shown");
|
||||
g_once_init_leave (&warned_current_time, warned);
|
||||
}
|
||||
#ifdef GDK_WINDOWING_X11
|
||||
if (GDK_IS_X11_WINDOW(gdk_window))
|
||||
{
|
||||
@@ -12800,9 +12766,7 @@ gtk_window_set_debugging (gboolean enable,
|
||||
|
||||
if (enable)
|
||||
{
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
gtk_window_present (GTK_WINDOW (inspector_window));
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
if (dialog)
|
||||
gtk_widget_show (dialog);
|
||||
|
||||
|
||||
@@ -366,7 +366,7 @@ GDK_AVAILABLE_IN_ALL
|
||||
gboolean gtk_window_propagate_key_event (GtkWindow *window,
|
||||
GdkEventKey *event);
|
||||
|
||||
GDK_DEPRECATED_IN_3_24_FOR(gtk_window_present_with_time)
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gtk_window_present (GtkWindow *window);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gtk_window_present_with_time (GtkWindow *window,
|
||||
|
||||
@@ -139,8 +139,6 @@ void gtk_window_set_unlimited_guessed_size (GtkWindow *window,
|
||||
gboolean x,
|
||||
gboolean y);
|
||||
void gtk_window_force_resize (GtkWindow *window);
|
||||
void gtk_window_fixate_size (GtkWindow *window);
|
||||
void gtk_window_move_resize (GtkWindow *window);
|
||||
|
||||
/* Exported handles */
|
||||
|
||||
|
||||
@@ -2,16 +2,16 @@
|
||||
// it gets @if ed depending on $variant
|
||||
|
||||
|
||||
$base_color: if($variant == 'light', #ffffff, lighten(desaturate(#241f31, 100%), 2%));
|
||||
$base_color: if($variant == 'light', #ffffff, #232729);
|
||||
$text_color: if($variant == 'light', black, white);
|
||||
$bg_color: if($variant == 'light', #f6f5f4, darken(desaturate(#3d3846, 100%), 4%));
|
||||
$bg_color: if($variant == 'light', #e8e8e7, #33393b);
|
||||
$fg_color: if($variant == 'light', #2e3436, #eeeeec);
|
||||
|
||||
$selected_fg_color: #ffffff;
|
||||
$selected_bg_color: if($variant == 'light', #3584e4, darken(#3584e4, 20%));
|
||||
$selected_borders_color: if($variant== 'light', darken($selected_bg_color, 15%), darken($selected_bg_color, 30%));
|
||||
$borders_color: if($variant == 'light', darken($bg_color, 18%), darken($bg_color, 10%));
|
||||
$alt_borders_color: if($variant == 'light', darken($bg_color, 24%), darken($bg_color, 18%));
|
||||
$selected_bg_color: if($variant == 'light', #4a90d9, darken(#4a90d9, 20%));
|
||||
$selected_borders_color: if($variant== 'light', darken($selected_bg_color, 30%), darken($selected_bg_color, 20%));
|
||||
$borders_color: if($variant == 'light', darken($bg_color, 20%), darken($bg_color, 10%));
|
||||
$alt_borders_color: if($variant == 'light', darken($bg_color, 35%), darken($bg_color, 17%));
|
||||
$borders_edge: if($variant == 'light', transparentize(white, 0.2), transparentize($fg_color, 0.93));
|
||||
$link_color: if($variant == 'light', darken($selected_bg_color, 10%), lighten($selected_bg_color, 20%));
|
||||
$link_visited_color: if($variant == 'light', darken($selected_bg_color, 20%), lighten($selected_bg_color, 10%));
|
||||
@@ -29,12 +29,12 @@ $scrollbar_slider_active_color: if($variant=='light', darken($selected_bg_color,
|
||||
|
||||
$warning_color: #f57900;
|
||||
$error_color: #cc0000;
|
||||
$success_color: if($variant == 'light', #33d17a, darken(#33d17a, 10%));
|
||||
$destructive_color: if($variant == 'light', #e01b24, darken(#e01b24, 10%));
|
||||
$success_color: if($variant == 'light', #73d216, darken(#73d216, 10%));
|
||||
$destructive_color: if($variant == 'light', #ef2929, darken(#ef2929, 10%));
|
||||
|
||||
$osd_fg_color: #eeeeec;
|
||||
$osd_text_color: white;
|
||||
$osd_bg_color: transparentize(darken(#3d3846,10%), 0.3);
|
||||
$osd_bg_color: transparentize(#1c1f20, 0.3);
|
||||
$osd_insensitive_bg_color: transparentize(mix($osd_fg_color, opacify($osd_bg_color, 1), 10%), 0.5);
|
||||
$osd_insensitive_fg_color: mix($osd_fg_color, opacify($osd_bg_color, 1), 50%);
|
||||
$osd_borders_color: transparentize(black, 0.3);
|
||||
|
||||
@@ -6,9 +6,6 @@ $ease-out-quad: cubic-bezier(0.25, 0.46, 0.45, 0.94);
|
||||
$asset_suffix: if($variant=='dark', '-dark', '');
|
||||
$backdrop_transition: 200ms ease-out;
|
||||
$button_transition: all 200ms $ease-out-quad;
|
||||
$button_radius: 5px;
|
||||
$menu_radius: 5px;
|
||||
$window_radius: $button_radius + 3;
|
||||
|
||||
* {
|
||||
padding: 0;
|
||||
@@ -267,7 +264,7 @@ entry {
|
||||
padding-left: 8px;
|
||||
padding-right: 8px;
|
||||
border: 1px solid;
|
||||
border-radius: $button_radius;
|
||||
border-radius: 3px;
|
||||
transition: all 200ms $ease-out-quad;
|
||||
|
||||
@include entry(normal);
|
||||
@@ -277,6 +274,10 @@ entry {
|
||||
&.right { margin-left: 6px; }
|
||||
}
|
||||
|
||||
undershoot {
|
||||
&.left { @include undershoot(left); }
|
||||
&.right { @include undershoot(right); }
|
||||
}
|
||||
|
||||
&.flat {
|
||||
&:focus, &:backdrop, &:disabled, &:backdrop:disabled, & {
|
||||
@@ -523,9 +524,9 @@ button {
|
||||
|
||||
min-height: 24px;
|
||||
min-width: 16px;
|
||||
padding: 4px 9px;
|
||||
padding: 4px 8px;
|
||||
border: 1px solid;
|
||||
border-radius: $button_radius;
|
||||
border-radius: 3px;
|
||||
transition: $button_transition;
|
||||
|
||||
@include button(normal);
|
||||
@@ -588,8 +589,8 @@ button {
|
||||
|
||||
&.image-button {
|
||||
min-width: 24px;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
padding-left: 4px;
|
||||
padding-right: 4px;
|
||||
}
|
||||
|
||||
&.text-button {
|
||||
@@ -630,10 +631,10 @@ button {
|
||||
|
||||
// big standalone buttons like in Documents pager
|
||||
&.osd {
|
||||
min-width: 26px;
|
||||
min-width: 24px;
|
||||
min-height: 32px;
|
||||
|
||||
&.image-button { min-width: 34px; }
|
||||
&.image-button { min-width: 32px; }
|
||||
|
||||
color: $osd_fg_color;
|
||||
border-radius: 5px;
|
||||
@@ -849,7 +850,6 @@ button {
|
||||
&.circular { // The Bloody Circul Button
|
||||
border-radius: 9999px;
|
||||
-gtk-outline-radius: 9999px;
|
||||
padding: 4px; /* circles instead of ellipses */
|
||||
|
||||
label { padding: 0; }
|
||||
|
||||
@@ -862,14 +862,12 @@ button {
|
||||
|
||||
&:not(.flat):not(:checked):not(:active):not(:disabled):not(:backdrop) {
|
||||
@include button(normal);
|
||||
|
||||
background-image: $button_fill, $_border_bg;
|
||||
border-color: transparent;
|
||||
}
|
||||
|
||||
&:hover:not(:checked):not(:active):not(:disabled):not(:backdrop) {
|
||||
@include button(hover);
|
||||
|
||||
background-image: $button_fill, $_border_bg;
|
||||
border-color: transparent;
|
||||
}
|
||||
@@ -961,8 +959,8 @@ toolbar.inline-toolbar toolbutton:backdrop {
|
||||
}
|
||||
|
||||
%linked_left {
|
||||
border-top-left-radius: $button_radius;
|
||||
border-bottom-left-radius: $button_radius;
|
||||
border-top-left-radius: 3px;
|
||||
border-bottom-left-radius: 3px;
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
border-right-style: none;
|
||||
@@ -971,8 +969,8 @@ toolbar.inline-toolbar toolbutton:backdrop {
|
||||
%linked_right {
|
||||
border-top-left-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
border-top-right-radius: $button_radius;
|
||||
border-bottom-right-radius: $button_radius;
|
||||
border-top-right-radius: 3px;
|
||||
border-bottom-right-radius: 3px;
|
||||
border-right-style: solid;
|
||||
}
|
||||
|
||||
@@ -984,7 +982,7 @@ toolbar.inline-toolbar toolbutton:backdrop {
|
||||
&:last-child { @extend %linked_right; }
|
||||
|
||||
&:only-child {
|
||||
border-radius: $button_radius;
|
||||
border-radius: 3px;
|
||||
border-style: solid;
|
||||
}
|
||||
}
|
||||
@@ -1004,7 +1002,7 @@ toolbar.inline-toolbar toolbutton:backdrop {
|
||||
}
|
||||
|
||||
&:only-child {
|
||||
border-radius: $button_radius;
|
||||
border-radius: 3px;
|
||||
border-style: solid;
|
||||
}
|
||||
}
|
||||
@@ -1018,18 +1016,18 @@ toolbar.inline-toolbar toolbutton:backdrop {
|
||||
@extend %linked_vertical_middle;
|
||||
|
||||
&:first-child {
|
||||
border-top-left-radius: $button_radius;
|
||||
border-top-right-radius: $button_radius;
|
||||
border-top-left-radius: 3px;
|
||||
border-top-right-radius: 3px;
|
||||
}
|
||||
|
||||
&:last-child {
|
||||
border-bottom-left-radius: $button_radius;
|
||||
border-bottom-right-radius: $button_radius;
|
||||
border-bottom-left-radius: 3px;
|
||||
border-bottom-right-radius: 3px;
|
||||
border-style: solid;
|
||||
}
|
||||
|
||||
&:only-child {
|
||||
border-radius: $button_radius;
|
||||
border-radius: 3px;
|
||||
border-style: solid;
|
||||
}
|
||||
}
|
||||
@@ -1050,7 +1048,7 @@ modelbutton.flat,
|
||||
min-height: 26px;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
border-radius: $button_radius;
|
||||
border-radius: 3px;
|
||||
outline-offset: -2px;
|
||||
|
||||
@extend %undecorated_button;
|
||||
@@ -1096,12 +1094,6 @@ button.color {
|
||||
}
|
||||
}
|
||||
|
||||
/* list buttons */
|
||||
/* tone down as per new designs, see issue #1473 */
|
||||
list row button {
|
||||
@extend %undecorated_button;
|
||||
border: 1px solid transparentize($borders_color, .5);
|
||||
}
|
||||
|
||||
/*********
|
||||
* Links *
|
||||
@@ -1129,8 +1121,6 @@ list row button {
|
||||
*:selected & { color: mix($selected_fg_color, $selected_bg_color, 80%); }
|
||||
}
|
||||
|
||||
&:disabled, &:disabled:backdrop { color: transparentize(desaturate($link_color,100%), 0.2); }
|
||||
|
||||
&:backdrop { &:backdrop:hover, &:backdrop:hover:selected, & { color: $selected_bg_color; }}
|
||||
|
||||
@at-root %link_selected,
|
||||
@@ -1158,7 +1148,6 @@ button:visited {
|
||||
@extend %link;
|
||||
|
||||
text-decoration-line: underline;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1175,7 +1164,7 @@ spinbutton {
|
||||
|
||||
padding: 0;
|
||||
|
||||
%spinbutton_horz_entry {
|
||||
entry {
|
||||
min-width: 28px;
|
||||
// reset all the other props since the spinbutton node is styled here
|
||||
margin: 0;
|
||||
@@ -1188,10 +1177,6 @@ spinbutton {
|
||||
&:backdrop:disabled { background-color: transparent; }
|
||||
}
|
||||
|
||||
entry {
|
||||
@extend %spinbutton_horz_entry;
|
||||
}
|
||||
|
||||
button {
|
||||
min-height: 16px;
|
||||
margin: 0;
|
||||
@@ -1237,18 +1222,14 @@ spinbutton {
|
||||
&:dir(rtl) { border-style: none solid none none; }
|
||||
}
|
||||
|
||||
&:dir(ltr):last-child { border-radius: 0 $button_radius $button_radius 0; }
|
||||
&:dir(ltr):last-child { border-radius: 0 3px 3px 0; }
|
||||
|
||||
&:dir(rtl):first-child { border-radius: $button_radius 0 0 $button_radius; }
|
||||
&:dir(rtl):first-child { border-radius: 3px 0 0 3px; }
|
||||
}
|
||||
}
|
||||
|
||||
// OSD horizontal
|
||||
.osd &:not(.vertical) {
|
||||
entry {
|
||||
@extend %spinbutton_horz_entry;
|
||||
}
|
||||
|
||||
button {
|
||||
@include button(undecorated);
|
||||
|
||||
@@ -1289,9 +1270,9 @@ spinbutton {
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
&:dir(ltr):last-child { border-radius: 0 $button_radius $button_radius 0; }
|
||||
&:dir(ltr):last-child { border-radius: 0 3px 3px 0; }
|
||||
|
||||
&:dir(rtl):first-child { border-radius: $button_radius 0 0 $button_radius; }
|
||||
&:dir(rtl):first-child { border-radius: 3px 0 0 3px; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1330,12 +1311,12 @@ spinbutton {
|
||||
}
|
||||
|
||||
%top_button {
|
||||
border-radius: $button_radius $button_radius 0 0;
|
||||
border-radius: 3px 3px 0 0;
|
||||
border-style: solid solid none solid;
|
||||
}
|
||||
|
||||
%bottom_button {
|
||||
border-radius: 0 0 $button_radius $button_radius;
|
||||
border-radius: 0 0 3px 3px;
|
||||
border-style: none solid solid solid;
|
||||
}
|
||||
}
|
||||
@@ -1509,7 +1490,7 @@ headerbar {
|
||||
border-color: $alt_borders_color;
|
||||
border-radius: 0;
|
||||
|
||||
@include headerbar_fill(darken($bg_color, 10%));
|
||||
@include headerbar_fill;
|
||||
|
||||
&:backdrop {
|
||||
border-color: $backdrop_borders_color;
|
||||
@@ -1534,18 +1515,6 @@ headerbar {
|
||||
@extend .dim-label;
|
||||
}
|
||||
|
||||
/* Darken switchbuttons for headerbars. issue #1588 */
|
||||
stackswitcher button:checked,
|
||||
button.toggle:checked {
|
||||
|
||||
background: if($variant == 'light', image(darken($bg_color, 17%)), image(darken($bg_color, 9%)));
|
||||
border-color: darken($borders_color, 3%);
|
||||
border-top-color: darken($borders_color, 8%);
|
||||
&:backdrop {
|
||||
@include button(backdrop-active);
|
||||
}
|
||||
}
|
||||
|
||||
.selection-mode &,
|
||||
&.selection-mode {
|
||||
$_hc: mix($top_hilight,$selected_bg_color, 50%); // hilight color
|
||||
@@ -1560,11 +1529,6 @@ headerbar {
|
||||
background-color: $selected_bg_color;
|
||||
background-image: none;
|
||||
box-shadow: inset 0 1px mix($top_hilight, $selected_bg_color, 60%);
|
||||
|
||||
label {
|
||||
text-shadow: none;
|
||||
color: $selected_fg_color;
|
||||
}
|
||||
}
|
||||
|
||||
.subtitle:link { @extend *:link:selected; }
|
||||
@@ -1659,8 +1623,8 @@ headerbar {
|
||||
background-color: transparentize($selected_bg_color, 1);
|
||||
background-image: none;
|
||||
box-shadow: none;
|
||||
min-height: 20px;
|
||||
padding: 6px 10px;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
|
||||
arrow { -GtkArrow-arrow-scaling: 1; }
|
||||
|
||||
@@ -1697,10 +1661,6 @@ headerbar {
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
separator.titlebutton { opacity: 0; } /* hide the close button separator */
|
||||
|
||||
.solid-csd & {
|
||||
&:backdrop, & {
|
||||
@@ -1742,8 +1702,8 @@ headerbar {
|
||||
|
||||
.background .titlebar {
|
||||
&:backdrop, & {
|
||||
border-top-left-radius: $window_radius;
|
||||
border-top-right-radius: $window_radius;
|
||||
border-top-left-radius: 7px;
|
||||
border-top-right-radius: 7px;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1815,28 +1775,11 @@ headerbar { // headerbar border rounding
|
||||
|
||||
window.devel {
|
||||
headerbar.titlebar:not(.selection-mode) {
|
||||
$c: darken($bg_color, 10%);
|
||||
$gradient: -gtk-icontheme("system-run-symbolic") 90% 0/256px 256px no-repeat,
|
||||
linear-gradient(to right, transparent 65%, transparentize($selected_bg_color, 0.8)),
|
||||
linear-gradient(to top, darken($c, 3%), $c 3px, lighten($c, 6%));
|
||||
@if $variant == 'dark' {
|
||||
$gradient: -gtk-icontheme("system-run-symbolic") 90% 0/256px 256px no-repeat,
|
||||
linear-gradient(to right, transparent 65%, transparentize($selected_bg_color, 0.9)),
|
||||
linear-gradient(to top, lighten($c, 3%) 3px, lighten($c, 5%));
|
||||
}
|
||||
|
||||
background: $bg_color $gradient;
|
||||
background: transparent -gtk-icontheme("system-run-symbolic") 90% 0/256px 256px no-repeat,
|
||||
linear-gradient(to left, mix($selected_bg_color, $bg_color, 10%) 8%, $bg_color 25%);
|
||||
color: transparentize($fg_color,.9);
|
||||
|
||||
label { color: $fg_color; }
|
||||
|
||||
&:backdrop {
|
||||
background: $bg_color -gtk-icontheme("system-run-symbolic") 90% 0/256px 256px no-repeat,
|
||||
image($bg_color); /* background-color would flash */
|
||||
color: transparentize($fg_color,.95);
|
||||
|
||||
label { color: $backdrop_fg_color; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2109,7 +2052,6 @@ treeview.view {
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*********
|
||||
* Menus *
|
||||
*********/
|
||||
@@ -2125,16 +2067,6 @@ menubar,
|
||||
min-height: 16px;
|
||||
padding: 4px 8px;
|
||||
|
||||
// remove padding and rounding from menubar submenus
|
||||
menu {
|
||||
border-radius: 0;
|
||||
padding:0;
|
||||
menu {
|
||||
border-radius: 0;
|
||||
padding:0;
|
||||
}
|
||||
}
|
||||
|
||||
&:hover { //Seems like it :hover even with keyboard focus
|
||||
box-shadow: inset 0 -3px $selected_bg_color;
|
||||
color: $link_color;
|
||||
@@ -2145,23 +2077,15 @@ menubar,
|
||||
box-shadow: none;
|
||||
}
|
||||
}
|
||||
|
||||
// remove padding and rounding from menubar submenu decoration
|
||||
.csd.popup decoration {border-radius:0;}
|
||||
}
|
||||
|
||||
// Needed to make the border-radius of menus work
|
||||
// otherwise the background bleeds out of the menu edges
|
||||
.background.popup { background-color: transparent; }
|
||||
|
||||
menu,
|
||||
.menu,
|
||||
.context-menu {
|
||||
margin: 4px; // see https://bugzilla.gnome.org/show_bug.cgi?id=591258
|
||||
padding: 4px 0px;
|
||||
padding: 2px 0px;
|
||||
background-color: $menu_color;
|
||||
border: 1px solid $borders_color; // adds borders in a non composited env
|
||||
border-radius: $menu_radius;
|
||||
|
||||
.csd & { border: none; } // axes borders in a composited env
|
||||
|
||||
@@ -2221,19 +2145,14 @@ menu,
|
||||
border-radius: 0;
|
||||
|
||||
&.top {
|
||||
margin-top: -4px;
|
||||
margin-top: -6px;
|
||||
border-bottom: 1px solid mix($fg_color, $base_color, 10%);
|
||||
border-top-right-radius: $menu_radius;
|
||||
border-top-left-radius: $menu_radius;
|
||||
-gtk-icon-source: -gtk-icontheme('pan-up-symbolic');
|
||||
}
|
||||
|
||||
&.bottom {
|
||||
margin-top: 8px;
|
||||
margin-bottom: -12px;
|
||||
margin-bottom: -6px;
|
||||
border-top: 1px solid mix($fg_color, $base_color, 10%);
|
||||
border-bottom-right-radius: $menu_radius;
|
||||
border-bottom-left-radius: $menu_radius;
|
||||
-gtk-icon-source: -gtk-icontheme('pan-down-symbolic');
|
||||
}
|
||||
|
||||
@@ -2268,7 +2187,7 @@ menuitem {
|
||||
|
||||
popover.background {
|
||||
padding: 2px;
|
||||
border-radius: $menu_radius + 4;
|
||||
border-radius: 5px;
|
||||
background-color: $popover_bg_color;
|
||||
|
||||
.csd &, & { border: 1px solid $borders_color; }
|
||||
@@ -2758,11 +2677,13 @@ treeview ~ scrollbar.vertical {
|
||||
* Switch *
|
||||
**********/
|
||||
switch {
|
||||
font-weight: bold;
|
||||
font-size: smaller;
|
||||
outline-offset: -4px;
|
||||
|
||||
// similar to the .scale
|
||||
border: 1px solid $borders_color;
|
||||
border-radius: 14px;
|
||||
border-radius: 3px;
|
||||
color: $fg_color;
|
||||
background-color: $dark_fill;
|
||||
text-shadow: 0 1px transparentize(black, 0.9);
|
||||
@@ -2805,18 +2726,15 @@ switch {
|
||||
|
||||
slider {
|
||||
margin: -1px;
|
||||
min-width: 24px;
|
||||
min-height: 24px;
|
||||
min-width: 44px;
|
||||
min-height: 26px;
|
||||
border: 1px solid;
|
||||
border-radius: 50%;
|
||||
border-radius: 3px;
|
||||
transition: $button_transition;
|
||||
-gtk-outline-radius: 20px;
|
||||
|
||||
@include button(normal-alt, $edge: $shadow_color);
|
||||
}
|
||||
|
||||
image { color: transparent; } /* only show i / o for the accessible theme */
|
||||
|
||||
&:hover slider { @include button(hover-alt, $edge: $shadow_color); }
|
||||
|
||||
&:checked slider { border: 1px solid $selected_borders_color; }
|
||||
@@ -2848,7 +2766,6 @@ switch {
|
||||
slider { &:checked, & { border-color: $selected_borders_color; } }
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -2860,30 +2777,25 @@ switch {
|
||||
|
||||
|
||||
//selection-mode
|
||||
@each $check_state, $check_icon, $check_color, $check_background in
|
||||
('', 'none', 'transparent', '#{transparentize($selected_bg_color, .05)}'),
|
||||
(':hover', 'none', 'transparent', '#{transparentize($selected_bg_color, .05)}'),
|
||||
(':active', 'none', 'transparent', '#{transparentize($selected_bg_color, .05)}'),
|
||||
(':backdrop', 'none', 'transparent', '#{transparentize(desaturate($selected_bg_color, 100%), .05)}'),
|
||||
(':checked', '-gtk-icontheme(\'object-select-symbolic\')', '#{$osd_fg_color}', '#{transparentize($selected_bg_color, .05)}'),
|
||||
(':checked:hover', '-gtk-icontheme(\'object-select-symbolic\')', '#{$osd_fg_color}', '#{transparentize($selected_bg_color, .05)}'),
|
||||
(':checked:active', '-gtk-icontheme(\'object-select-symbolic\')', '#{$osd_fg_color}', '#{transparentize($selected_bg_color, .05)}'),
|
||||
(':backdrop:checked', '-gtk-icontheme(\'object-select-symbolic\')', '#{transparentize($osd_fg_color, 0.2)}', '#{transparentize(desaturate($selected_bg_color, 100%), .05)}'), {
|
||||
|
||||
.view.content-view.check#{$check_state}:not(list),
|
||||
.content-view .tile check#{$check_state}:not(list) {
|
||||
margin: 4px;
|
||||
min-width: 32px;
|
||||
min-height: 32px;
|
||||
color: #{$check_color};
|
||||
background-color: #{$check_background};
|
||||
border-radius: 5px;
|
||||
@each $s,$as in ('','-selectionmode'),
|
||||
(':hover', '-hover-selectionmode'),
|
||||
(':active', '-active-selectionmode'),
|
||||
(':backdrop', '-backdrop-selectionmode'),
|
||||
(':checked', '-checked-selectionmode'),
|
||||
(':checked:hover', '-checked-hover-selectionmode'),
|
||||
(':checked:active', '-checked-active-selectionmode'),
|
||||
(':backdrop:checked', '-checked-backdrop-selectionmode') {
|
||||
.view.content-view.check#{$s}:not(list),
|
||||
.content-view .tile check#{$s}:not(list) {
|
||||
-gtk-icon-shadow: none;
|
||||
-gtk-icon-source: -gtk-scaled(url("assets/checkbox#{$as}.png"), url("assets/checkbox#{$as}@2.png"));
|
||||
background-color: transparent;
|
||||
min-width: 40px;
|
||||
min-height: 40px;
|
||||
background-image: none;
|
||||
transition: 200ms;
|
||||
transition: none;
|
||||
box-shadow: none;
|
||||
border-width: 0;
|
||||
-gtk-icon-source: #{$check_icon};
|
||||
-gtk-icon-shadow: none;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3715,6 +3627,16 @@ scrolledwindow {
|
||||
}
|
||||
}
|
||||
|
||||
// Overflow indication, works similarly to the overshoot, the size if fixed tho.
|
||||
undershoot {
|
||||
&.top { @include undershoot(top); }
|
||||
|
||||
&.bottom { @include undershoot(bottom); }
|
||||
|
||||
&.left { @include undershoot(left); }
|
||||
|
||||
&.right { @include undershoot(right); }
|
||||
}
|
||||
|
||||
junction { // the small square between two scrollbars
|
||||
border-color: transparent;
|
||||
@@ -3892,8 +3814,8 @@ messagedialog { // Message Dialog styling
|
||||
&.csd { // rounded bottom border styling for csd version
|
||||
&.background {
|
||||
// bigger radius for better antialiasing
|
||||
border-bottom-left-radius: $window_radius+1;
|
||||
border-bottom-right-radius: $window_radius+1;
|
||||
border-bottom-left-radius: 9px;
|
||||
border-bottom-right-radius: 9px;
|
||||
}
|
||||
|
||||
.dialog-action-area button {
|
||||
@@ -3949,7 +3871,7 @@ filechooserbutton:drop(active) {
|
||||
border-left-style: none;
|
||||
}
|
||||
|
||||
@at-root %sidebar_right,
|
||||
@at-root %sidebar_right
|
||||
&:dir(rtl),
|
||||
&.right {
|
||||
border-left: 1px solid $borders_color;
|
||||
@@ -4451,7 +4373,7 @@ colorchooser .popover.osd { border-radius: 5px; }
|
||||
* Window Decorations *
|
||||
*********************/
|
||||
decoration {
|
||||
border-radius: $window_radius $window_radius 0 0;
|
||||
border-radius: 7px 7px 0 0;
|
||||
// lamefun trick to get rounded borders regardless of CSD use
|
||||
border-width: 0px;
|
||||
|
||||
@@ -4493,7 +4415,7 @@ decoration {
|
||||
.ssd & { box-shadow: 0 0 0 1px $_wm_border; } //just doing borders, wm draws actual shadows
|
||||
|
||||
.csd.popup & {
|
||||
border-radius: $menu_radius;
|
||||
border-radius: 0;
|
||||
box-shadow: 0 1px 2px transparentize(black, 0.8),
|
||||
0 0 0 1px transparentize($_wm_border, 0.1);
|
||||
}
|
||||
@@ -4504,7 +4426,7 @@ decoration {
|
||||
}
|
||||
|
||||
messagedialog.csd & {
|
||||
border-radius: $window_radius;
|
||||
border-radius: 7px;
|
||||
box-shadow: 0 1px 2px transparentize(black, 0.8),
|
||||
0 0 0 1px transparentize($_wm_border, 0.1);
|
||||
}
|
||||
@@ -4646,23 +4568,6 @@ stackswitcher button.text-button.circular { // FIXME aggregate with buttons
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/*************
|
||||
* App Icons *
|
||||
*************/
|
||||
/* Outline for low res icons */
|
||||
.lowres-icon {
|
||||
-gtk-icon-shadow: 1px 1px rgba(0,0,0,0.3),
|
||||
-1px -1px rgba(0,0,0,0.3),
|
||||
-1px 1px rgba(0,0,0,0.3),
|
||||
1px -1px rgba(0,0,0,0.3);
|
||||
}
|
||||
|
||||
/* Drapshadow for large icons */
|
||||
.icon-dropshadow {
|
||||
-gtk-icon-shadow: 0 2px 12px rgba(0,0,0,0.2),
|
||||
0 1px 2px rgba(0,0,0,0.7);
|
||||
}
|
||||
|
||||
/*********
|
||||
* Emoji *
|
||||
********/
|
||||
|
||||
@@ -115,8 +115,8 @@
|
||||
// buttons
|
||||
|
||||
@function _border_color($c, $darker: false) {
|
||||
@if $darker == true { @return darken($c, 20%); }
|
||||
@else { @return darken($c, 10%); }
|
||||
@if $darker == true { @return darken($c, 30%); }
|
||||
@else { @return darken($c, 20%); }
|
||||
}
|
||||
|
||||
@function _text_shadow_color ($tc: $fg_color, $bg: $bg_color) {
|
||||
@@ -139,10 +139,10 @@
|
||||
//
|
||||
@if lightness($c)>95% { @return white; }
|
||||
@else if lightness($c)>90% { @return transparentize(white, 0.2); }
|
||||
@else if lightness($c)>80% { @return transparentize(white, 0.5); }
|
||||
@else if lightness($c)>50% { @return transparentize(white, 0.8); }
|
||||
@else if lightness($c)>40% { @return transparentize(white, 0.9); }
|
||||
@else { @return transparentize(white, 0.98); }
|
||||
@else if lightness($c)>80% { @return transparentize(white, 0.4); }
|
||||
@else if lightness($c)>50% { @return transparentize(white, 0.6); }
|
||||
@else if lightness($c)>40% { @return transparentize(white, 0.8); }
|
||||
@else { @return transparentize(white, 0.95); }
|
||||
}
|
||||
|
||||
@mixin _button_text_shadow ($tc:$fg_color, $bg:$bg_color) {
|
||||
@@ -186,7 +186,6 @@
|
||||
$_hilight_color: _button_hilight_color($c);
|
||||
$_button_edge: if($edge == none, none, _widget_edge($edge));
|
||||
$_blank_edge: if($edge == none, none, _widget_edge(transparentize($edge,1)));
|
||||
$_button_shadow: 0 1px 2px transparentize($shadow_color, 0.03);
|
||||
|
||||
@if $t==normal {
|
||||
//
|
||||
@@ -196,11 +195,11 @@
|
||||
outline-color: transparentize($tc, 0.7);
|
||||
border-color: if($c != $bg_color, _border_color($c), $borders_color);
|
||||
border-bottom-color: if($c != $bg_color, _border_color($c, true), $alt_borders_color);
|
||||
$button_fill: if($variant == 'light', linear-gradient(to top, darken($c, 4%) 2px, $c),
|
||||
linear-gradient(to top, darken($c,1%) 2px, $c)) !global;
|
||||
$button_fill: if($variant == 'light', linear-gradient(to bottom, $c, darken($c, 4%) 60%, darken($c, 10%)),
|
||||
linear-gradient(to bottom, darken($c, 2%), darken($c, 4%) 60%, darken($c, 6%))) !global;
|
||||
background-image: $button_fill;
|
||||
@include _button_text_shadow($tc, $c);
|
||||
@include _shadows(inset 0 1px $_hilight_color, $_button_edge, $_button_shadow);
|
||||
@include _shadows(inset 0 1px $_hilight_color, $_button_edge);
|
||||
}
|
||||
|
||||
@else if $t==hover {
|
||||
@@ -212,14 +211,14 @@
|
||||
border-color: if($c != $bg_color, _border_color($c), $borders_color);
|
||||
border-bottom-color: if($c != $bg_color, _border_color($c, true), $alt_borders_color);
|
||||
@if $variant == 'light' {
|
||||
$button_fill: linear-gradient(to top, $c, lighten($c, 1%) 1px) !global;
|
||||
$button_fill: linear-gradient(to bottom, lighten($c, 6%), $c 60%, darken($c, 4%)) !global;
|
||||
@include _button_text_shadow($tc, lighten($c, 6%));
|
||||
@include _shadows(inset 0 1px _button_hilight_color(lighten($c, 6%)), $_button_edge, $_button_shadow);
|
||||
@include _shadows(inset 0 1px _button_hilight_color(lighten($c, 6%)), $_button_edge);
|
||||
}
|
||||
@else {
|
||||
$button_fill: linear-gradient(to top, darken($c,1%), lighten($c, 1%) 1px) !global;
|
||||
$button_fill: linear-gradient(to bottom, lighten($c, 1%), darken($c, 2%) 60%, darken($c, 4%)) !global;
|
||||
@include _button_text_shadow($tc,lighten($c, 6%));
|
||||
@include _shadows(inset 0 1px _button_hilight_color(darken($c, 2%)), $_button_edge, $_button_shadow);
|
||||
@include _shadows(inset 0 1px _button_hilight_color(darken($c, 2%)), $_button_edge);
|
||||
}
|
||||
background-image: $button_fill;
|
||||
}
|
||||
@@ -234,13 +233,17 @@
|
||||
@include _button_text_shadow($tc, $c);
|
||||
@if $variant == 'light' {
|
||||
background-image: linear-gradient(to bottom, lighten($c, 5%) 20%, $c 90%);
|
||||
@include _shadows(inset 0 1px _button_hilight_color(lighten($c, 6%)),
|
||||
$_button_edge, $_button_shadow);
|
||||
@include _shadows(inset 0 1px _button_hilight_color(lighten($c, 6%)),
|
||||
inset 0 -2px lighten($c, 2%),
|
||||
inset 0 -1px darken($c, 12%),
|
||||
$_button_edge);
|
||||
}
|
||||
@else {
|
||||
background-image: linear-gradient(to bottom, darken($c, 3%) 20%, darken($c, 6%) 90%);
|
||||
@include _shadows(inset 0 1px $_hilight_color,
|
||||
$_button_edge, $_button_shadow);
|
||||
inset 0 -2px darken($c, 4%),
|
||||
inset 0 -1px darken($c, 9%),
|
||||
$_button_edge);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -254,12 +257,16 @@
|
||||
@if $variant == 'light' {
|
||||
$button_fill: linear-gradient(to bottom, lighten($c, 9%) 10%, lighten($c, 4%) 90%) !global;
|
||||
@include _shadows(inset 0 1px _button_hilight_color(lighten($c, 6%)),
|
||||
$_button_edge, $_button_shadow);
|
||||
inset 0 -2px lighten($c, 5%),
|
||||
inset 0 -1px darken($c, 10%),
|
||||
$_button_edge);
|
||||
}
|
||||
@else {
|
||||
$button_fill: linear-gradient(to bottom, $c 20%, darken($c, 4%) 90%) !global;
|
||||
@include _shadows(inset 0 1px $_hilight_color,
|
||||
$_button_edge, $_button_shadow);
|
||||
inset 0 -2px darken($c, 3%),
|
||||
inset 0 -1px darken($c, 6%),
|
||||
$_button_edge);
|
||||
}
|
||||
background-image: $button_fill;
|
||||
}
|
||||
@@ -271,7 +278,7 @@
|
||||
color: $tc;
|
||||
outline-color: transparentize($tc, 0.7);
|
||||
border-color: if($c != $bg_color, _border_color($c), $borders_color);
|
||||
$button_fill: if($variant == 'light', image(darken($c, 14%)), image(darken($c, 9%))) !global;
|
||||
$button_fill: image(darken($c, 6%)) !global;
|
||||
background-image: $button_fill;
|
||||
@include _shadows(inset 0 1px transparentize($_hilight_color, 1), $_button_edge);
|
||||
|
||||
@@ -492,9 +499,9 @@
|
||||
// $hc: top highlight color
|
||||
// $ov: a background layer for background shorthand (hence no commas!)
|
||||
//
|
||||
$gradient: linear-gradient(to top, darken($c, 2%), lighten($c, 1%));
|
||||
$gradient: linear-gradient(to top, darken($c, 13%), darken($c, 2%) 2px, $c 3px);
|
||||
|
||||
@if $variant == 'dark' { $gradient: linear-gradient(to top, lighten($c, 4%), lighten($c, 6%)); }
|
||||
@if $variant == 'dark' { $gradient: linear-gradient(to top, darken($c, 3%), darken($c, 1%) 2px, $c 3px); }
|
||||
|
||||
@if $ov != none { background: $c $ov, $gradient; }
|
||||
@else { background: $c $gradient; }
|
||||
@@ -581,4 +588,42 @@
|
||||
box-shadow: none; //
|
||||
}
|
||||
|
||||
@mixin undershoot($p) {
|
||||
//
|
||||
// undershoot
|
||||
//
|
||||
// $p: position
|
||||
//
|
||||
// possible $p values:
|
||||
// top, bottom, right, left
|
||||
//
|
||||
|
||||
$_undershoot_color_dark: transparentize(black, 0.8);
|
||||
$_undershoot_color_light: transparentize(white, 0.8);
|
||||
|
||||
$_gradient_dir: left;
|
||||
$_dash_bg_size: 10px 1px;
|
||||
$_gradient_repeat: repeat-x;
|
||||
$_bg_pos: center $p;
|
||||
|
||||
background-color: transparent; // shouldn't be needed, but better to be sure;
|
||||
|
||||
@if ($p == left) or ($p == right) {
|
||||
$_gradient_dir: top;
|
||||
$_dash_bg_size: 1px 10px;
|
||||
$_gradient_repeat: repeat-y;
|
||||
$_bg_pos: $p center;
|
||||
}
|
||||
|
||||
background-image: linear-gradient(to $_gradient_dir, // this is the dashed line
|
||||
$_undershoot_color_light 50%,
|
||||
$_undershoot_color_dark 50%);
|
||||
|
||||
padding-#{$p}: 1px;
|
||||
background-size: $_dash_bg_size;
|
||||
background-repeat: $_gradient_repeat;
|
||||
background-origin: content-box;
|
||||
background-position: $_bg_pos;
|
||||
border: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 209 KiB After Width: | Height: | Size: 228 KiB |
@@ -58,11 +58,3 @@ slider-vert-scale-has-marks-above-active-dark
|
||||
slider-vert-scale-has-marks-above-insensitive-dark
|
||||
slider-vert-scale-has-marks-above-backdrop-dark
|
||||
slider-vert-scale-has-marks-above-backdrop-insensitive-dark
|
||||
checkbox-selectionmode
|
||||
checkbox-checked-selectionmode
|
||||
checkbox-hover-selectionmode
|
||||
checkbox-checked-hover-selectionmode
|
||||
checkbox-active-selectionmode
|
||||
checkbox-checked-active-selectionmode
|
||||
checkbox-backdrop-selectionmode
|
||||
checkbox-checked-backdrop-selectionmode
|
||||
|
||||
|
Before Width: | Height: | Size: 891 B After Width: | Height: | Size: 870 B |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 824 B After Width: | Height: | Size: 801 B |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 876 B After Width: | Height: | Size: 902 B |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 883 B After Width: | Height: | Size: 929 B |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 891 B After Width: | Height: | Size: 879 B |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 937 B After Width: | Height: | Size: 990 B |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 754 B After Width: | Height: | Size: 773 B |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 754 B After Width: | Height: | Size: 760 B |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 782 B After Width: | Height: | Size: 780 B |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 788 B After Width: | Height: | Size: 763 B |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 889 B After Width: | Height: | Size: 831 B |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 841 B After Width: | Height: | Size: 834 B |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 831 B After Width: | Height: | Size: 968 B |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 754 B After Width: | Height: | Size: 767 B |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 793 B After Width: | Height: | Size: 807 B |