summaryrefslogtreecommitdiff
path: root/gtk/gtkviewport.c
Commit message (Collapse)AuthorAgeFilesLines
* pixelcache: Don't have a style context argumentBenjamin Otte2016-02-251-7/+24
| | | | | | | | That would imply the pixelcache monitors the style context for changes and it doesn't do that. Its only use case was opacity checks, so add gtk_pixel_cache_se_is_opaque() instead.
* viewport: Don't destroy pixelcache while it's still usedBenjamin Otte2016-01-201-4/+2
| | | | Removing the child unsets the pxielcache's style context...
* viewport: Set the pixel cache background from the childBenjamin Otte2016-01-201-5/+20
| | | | | | | | | The viewport itself doesn't move, so we cannot use it as the pixel cache's background. Use the bottommost using element instead, which is the viewport's child. This might need adaptations in themes as we want the backgroud to be opaque to speed up pixel cache performance.
* viewport: don't render a background over the bin windowCosimo Cecchi2015-12-291-11/+0
| | | | | | | | | | | | | | GtkViewport currently tries to draw a background over the bin window. The feature is a bit broken at the moment, as it does not take into account padding that might have been set on the GtkViewport, but in general it does not seem very useful, and goes somewhat against the CSS box model where every widget/gadget is responsible to draw its own background. For a fix, we could either have the viewport gain a "bin" gadget, or we could stop drawing the background. As it isn't clear that there are any users of this feature, stop drawing the background; a client can achieve the same effect by drawing the background on the widget inside the viewport itself.
* viewport: port to use a gadgetCosimo Cecchi2015-12-291-308/+285
| | | | | This will get us margin support, among other things, and simplifies the code.
* viewport: trivial code cleanupCosimo Cecchi2015-12-291-8/+9
|
* viewport: use gtk_container_class_handle_border_width()Cosimo Cecchi2015-12-291-19/+12
| | | | No need to do this manually.
* Don't pass widget state flags to GtkStyleContext APITimm Bäder2015-11-221-1/+1
|
* Cosmetic: Avoid explicit state variablesMatthias Clasen2015-11-141-4/+2
| | | | Using the state of the context makes this more obviously correct.
* viewport: Add an element name to the css nodeMatthias Clasen2015-10-291-2/+8
| | | | This lets us avoid hardcoding the type in CSS.
* gtk: Stop setting GDK_EXPOSURE_MASK on random widgetsAlexander Larsson2015-09-141-1/+1
| | | | | | | | | | | | | | These days exposure happens only on the native windows (generally the toplevel window) and is propagated down recursively. The expose event is only useful for backwards compat, and in fact, for double buffered widgets we totally ignore the event (and non-double buffering breaks on wayland). So, by not setting the mask we avoid emitting these events and then later ignoring them. We still keep it on eventbox, fixed and layout as these are used in weird ways that want backwards compat.
* viewport: share style context with pixelcacheChristian Hergert2015-09-131-0/+4
| | | | | | | This allows the pixel cache to opportunistically use CAIRO_CONTENT_COLOR instead of CAIRO_CONTENT_COLOR_ALPHA during surface creation. https://bugzilla.gnome.org/show_bug.cgi?id=754658
* viewport: don't call gtk_style_context_set_background()Cosimo Cecchi2015-07-011-29/+8
|
* viewport: Remove wrong save/restoreBenjamin Otte2014-10-131-4/+0
|
* stylecontext: Split render functions out into gtkrender.[ch]Benjamin Otte2014-10-031-0/+1
|
* GtkViewport: Use style classes for shadowMatthias Clasen2014-06-261-12/+12
| | | | | | | | Translate shadow != None into the FRAME style class. This doesn't change the style classes used for drawing, it only sets the style class permanently instead of saving and restoring in draw(). https://bugzilla.gnome.org/show_bug.cgi?id=732256
* viewport: Remove unused variableBenjamin Otte2014-06-101-1/+0
|
* GtkViewport: Don't do silly things in a setterMatthias Clasen2014-06-091-7/+1
| | | | Just queue a resize instead of fiddling with the size allocation.
* GtkViewport: Use G_PARAM_EXPLICIT_NOTIFYMatthias Clasen2014-06-091-6/+14
|
* viewport: Don't subtract borders and padding from -1Benjamin Otte2014-05-061-4/+8
| | | | | | -1 is a special value for "undefined" and needs to stay that way https://bugzilla.gnome.org/show_bug.cgi?id=729607
* viewport: Remove unneeded checksBenjamin Otte2014-05-011-5/+2
| | | | | Size vfuncs always get non-null out variables passed, so no need to check for NULL.
* viewport: Implement hfw properlyBenjamin Otte2014-05-011-7/+48
| | | | | Previously, the code would fall back on GtkBin's hfw implementation which didn't account for padding and borders.
* viewport: Use a convenience functionBenjamin Otte2014-05-011-5/+7
| | | | | That function looks longer than not using it, but we'll need it in the next commit.
* viewport: Request 2x border-widthBenjamin Otte2014-05-011-4/+1
| | | | | It's nice that bugs get pointed out in code comments. Fixing them would probably have been preferrable though.
* viewport: Call map/unmap functions on pixel cacheBenjamin Otte2014-04-101-0/+26
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=726475
* docs: use Returns: consistentlyWilliam Jon McCann2014-02-191-5/+5
| | | | Instead of Return value:
* docs: use proper apostropheWilliam Jon McCann2014-02-071-1/+1
| | | | https://wiki.gnome.org/Design/OS/Typography
* gtk: Use new macros for defining private dataEmmanuele Bassi2013-07-091-5/+2
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=702996
* Make GtkViewport use GtkPixelCacheAlexander Larsson2013-05-071-22/+82
| | | | | | | | Since gdk_window_move() no longer uses XCopyArea all scrolling now re-renders everything in the window. To get performance back we use a GtkPixelCache to store already drawn children, and we when we expose the viewport we just blit the offscreen to the right place.
* Always use gint for border_widthMatthias Clasen2013-05-041-1/+1
| | | | | | | This avoids an evil trap when doing MAX (..., ... - 2 * border_width) and the expression on the right gets promoted to unsigned, instead of going negative as you would expect. https://bugzilla.gnome.org/show_bug.cgi?id=699633
* GtkViewport: annotate the adjustment args of the constructorTorsten Schönfeld2013-02-181-3/+4
| | | | | | NULL is accepted here, so add (allow-none). https://bugzilla.gnome.org/show_bug.cgi?id=694022
* Add gtk_widget_(un)register_windowAlexander Larsson2013-02-071-5/+5
| | | | | | | | | | | | This replaces the previously hardcoded calls to gdk_window_set_user_data, and also lets us track which windows are a part of a widget. Old code should continue working as is, but new features that require the windows may not work perfectly. We need this for the transparent widget support to work, as we need to specially mark the windows of child widgets. https://bugzilla.gnome.org/show_bug.cgi?id=687842
* scrolledwindow: make gtk_scrolled_window_add() smartCosimo Cecchi2013-02-011-2/+3
| | | | | | | | | | There's really no reason why we shouldn't automatically create a GtkViewport when the widget added to GtkScrolledWindow is not a GtkScrollable, instead of just printing a g_warning. Copy the viewport special case into the scrolled window implementation of gtk_container_add(). https://bugzilla.gnome.org/show_bug.cgi?id=693015
* Use GTK_RESIZE_PARENT resize_mode for GtkViewportAlexander Larsson2012-12-121-1/+0
| | | | | | | | | | | | | | | | We used to use GTK_RESIZE_QUEUE, but that is problematic for e.g a GtkScrolledWindow with NEVER scroll policies, as size changes in ancestors will never get propagated to the scrolled window, causing it to not have the correct size. This is a slight performance hit, but in practice its not bound to be problematic. In typical UIs there is only a single "large" GtkScrolledWindow visible at a time, so a size requeust propagating out of such a window will only hit the smaller amount of widgetry outside the scrolled window, and additionally all such widgets will have their size request caches still valid. https://bugzilla.gnome.org/show_bug.cgi?id=690099
* docs: fix a number of typos and obsolete referencesCosimo Cecchi2012-07-021-1/+1
|
* gtk: Don't call gdk_window_process_updates() when scrollingBenjamin Otte2012-04-051-4/+1
| | | | | | | This can cause lagging when scrolling as it causes us to repaint on every scroll event. This wasn't historically a great problem, but with smooth scrolling we get a lot more events, so this now creates visible lagging on slower machines.
* types: Move GtkAdustment declaration to gtktypes.hBenjamin Otte2012-03-031-1/+2
| | | | | ... and make all the headers to not include gtkadjustment.h anymore. Of course, also include it in the source files instead.
* viewport: set GDK_SMOOTH_SCROLL_MASKCarlos Garnacho2012-03-011-3/+2
| | | | | This is so smooth scroll events are send/handled by the parent GtkScrolledWindow if any.
* viewport: select for touch eventsMatthias Clasen2012-03-011-1/+1
| | | | | | This makes kinetic scrolling work with viewports where the content does not otherwise select for button or touch events, such as testscrolledwindow's label.
* Change FSF AddressJavier Jardón2012-02-271-3/+1
|
* Fix padding handling in GtkViewportAlexander Larsson2012-02-201-1/+1
|
* Make the default background for GdkWindows transparentAlexander Larsson2012-02-091-1/+2
| | | | | | | | | | | | | With the changes in default CSS to make the default background transparent we ran into issues where intermediate GdkWindow (for instance the view_window in GtkViewport) where we didn't set an explicit background (because before they were always covered). So instead of showing throught the transparent windows were showing the default backgroind of the intermediate window (i.e. black). With this change we also needed to fix GtkViewport, as it was previously relying on the bin and view windows to cover widget->window so that the border was not visible if shadow_type was NONE.
* viewport: Set frame styleclass when getting border size during size allocationAlexander Larsson2012-02-091-0/+5
| | | | | Without this you don't get the right border/padding for widget->window and the border shows up under the scrolled contents.
* viewport: Get rid of deprecation warningsBenjamin Otte2011-11-171-8/+8
|
* viewport: Don't use deprecated functionsBenjamin Otte2011-11-171-2/+2
|
* viewport: adjustments are never NULLBenjamin Otte2011-11-171-16/+2
| | | | So there's no need to check for that in the getters.
* viewport: Initialize the adjustment in the init functionBenjamin Otte2011-11-171-0/+6
|
* viewport: Don't unset the adjustment on finalizeBenjamin Otte2011-11-171-13/+0
| | | | | We unset it on destroy already. This makes it consistent with all other scrollables.
* Replace some references to the GtkTable, use GtkGrid insteadJavier Jardón2011-09-291-1/+1
|
* Documentation fixesMatthias Clasen2011-09-251-4/+4
| | | | | Mostly making sure that return values and varargs don't loose their docs.