Commit Graph

22 Commits

Author SHA1 Message Date
Christian Weber
c1f51a7bf3 searchDisplay: Use the rowLimit we pass to the IconGrid
When displaying children, we need to make sure that we use the rowLimit
property that we pass to iconGrid, rather than assuming that it's
always MAX_SEARCH_RESULTS_ROWS in case some subclass (in an extension maybe)
wants to do something different.

https://bugzilla.gnome.org/show_bug.cgi?id=675527
2012-06-03 01:32:29 -04:00
Florian Müllner
b833aff3c8 baseIcon: Always recreate icon texture on style changes
Commit 26580f8f reintroduced an optimization on style changes to avoid
creating icons unconditionally. As this breaks icon theme changes (for
instance when toggling "High Contrast" in the universal access menu),
remove it again.

https://bugzilla.gnome.org/show_bug.cgi?id=672941
2012-04-13 11:12:24 +02:00
Jasper St. Pierre
15f881f967 st: Remove custom text direction stuff
Clutter has its own built-in system for managing text directions, like GTK+.
Convert over to use this.

https://bugzilla.gnome.org/show_bug.cgi?id=670034
2012-02-28 08:14:06 -05:00
Florian Müllner
1c0c42e8e7 iconGrid: Split vertical/horizontal item size
IconGrid items used to be square, so a single size value made
perfect sense. However, as contact search uses rectangular items,
using a single size is wrong - the allocated height ends up twice
the size of the visible height, which is particularly visible if
another provider displays results below contact results.

https://bugzilla.gnome.org/show_bug.cgi?id=670148
2012-02-15 22:14:11 +01:00
Jasper St. Pierre
27b34992c6 iconGrid: Don't enter an infinite loop
If both spacing and -shell-grid-item-size are 0, as they would be with nothing
setting them, we enter an infinite loop where we try to compute the layout.
Avoid the situation entirely by defaulting -shell-grid-item-size to a sane
value instead of 0.

https://bugzilla.gnome.org/show_bug.cgi?id=662747
2012-02-07 17:40:22 -05:00
Giovanni Campagna
26580f8f2c IconGrid: don't force the size of the icon
Forcing the icon size will distort it unnecessarily, and will
in any case not work if showing an animation (which is a ClutterGroup).
Instead, set the size on the bin, and make it align its child
if needed.

https://bugzilla.gnome.org/show_bug.cgi?id=666606
2011-12-20 19:25:52 +01:00
Giovanni Campagna
17c46c2452 Port everything to class framework
The last patch in the sequence. Every place that was previously
setting prototype has been ported to Lang.Class, to make code more
concise and allow for better toString().

https://bugzilla.gnome.org/show_bug.cgi?id=664436
2011-11-24 09:50:04 +01:00
Giovanni Campagna
d6b6f814d3 Port all classes with inheritance to class framework
All classes that have at least one other derived class (and thus
benefit from the framework) have been now ported. These includes
NMDevice, SearchProvider, AltTab.SwitcherList, and some other
stuff around.

https://bugzilla.gnome.org/show_bug.cgi?id=664436
2011-11-24 09:50:04 +01:00
Dan Winship
75b824d032 *.js: Make emacs modelines consistent
js2-mode is no longer developed and we recommend js-mode these days,
so switch the modelines to specify that, and make them consistent
across all files.

https://bugzilla.gnome.org/show_bug.cgi?id=660358
2011-10-11 08:05:12 -04:00
Alejandro Piñeiro
6934e4db26 Setting StWidget::label-actor on some ui elements
Specifically:
  * Icons on Alt+Tab menu
  * Icons on Ctrl+Alt+Tab menu
  * Icons on the list of applications
2011-04-27 02:09:11 +02:00
Maxim Ermilov
12bd374477 searchDisplay: don't create useless SearchResult's
average constructing time for 1 SearchResult is 3 ms.
It give > 400 result on query like 'a' (on my machine).
https://bugzilla.gnome.org/show_bug.cgi?id=645313
2011-03-22 02:50:32 +03:00
Maxim Ermilov
9ef4cc0ab9 iconGrid: remove unused variable in _computeLayout
https://bugzilla.gnome.org/show_bug.cgi?id=645313
2011-03-22 02:50:25 +03:00
Florian Müllner
e01971eac7 base-icon: Always recreate icon texture on style changes
Currently the icon texture is only updated on style changes when
the icon size is set from CSS and differs from the previously used
icon size.
As the style change may have been triggered by an icon theme change,
textures that are created for themed icons should always be recreated;
given that this is the case for most uses (with the exception of
file thumbnails), recreate the icon texture unconditionally to avoid
complexity.

https://bugzilla.gnome.org/show_bug.cgi?id=643738
2011-03-03 23:14:32 +01:00
Florian Müllner
a78e75775d base-icon: Enforce the requested icon size
Mainly due to StTextureCache's way of handling fallback icons, an
implementation of BaseIcon.createIcon() may return an icon smaller
than the requested size. Given that BaseIcon is not used for isolated
elements, but rather for groups of related items (App view, Dash,
Search Results, ...), having some elements end up with the wrong
size is more annoying than having some elements end up ugly due to
scaling, so explicitly enforce the requested icon size.

https://bugzilla.gnome.org/show_bug.cgi?id=642043
2011-02-26 00:06:44 +01:00
Owen W. Taylor
01b646169c Fix fuzziness for application icons
- Center the icon texture in the area allocated for it, and always give
  the nominal size - avoid off-by-one scaling if the parent allocated
  a little less or more size than we wanted.
- Use Math.floor() when centering horizontally to avoid allocation
  at a half pixel.

https://bugzilla.gnome.org/show_bug.cgi?id=642124
2011-02-11 16:21:11 -05:00
Florian Müllner
8cf9b5e5d2 base-icon: Add an option to not show the label
Currently there is a serious problem with ellipsization in various
parts of the overview. While wrapping the label or giving it more
space may be appropriate approaches for the application view, neither
works very well for the dash - possibly the best option there is to
not show the label at all.
So add a constructor parameter to BaseIcon to allow hiding the
label.

https://bugzilla.gnome.org/show_bug.cgi?id=636156
2011-02-09 21:36:54 +01:00
Maxim Ermilov
dafaab66b1 iconGrid: Exclude hidden children from the layout
As all children were considered for the grid's layout, hidden items showed up as
empty space. Instead, exclude hidden children from the layout, so that the grid is
only made up of visible items.

https://bugzilla.gnome.org/show_bug.cgi?id=631537
2010-12-18 22:23:38 +03:00
Dan Winship
8886b7433c StThemeNode: simplify use of get_color/get_double/get_length
Although within St itself there are situations where the semantics of
these functions (return TRUE or FALSE and return the actual value in
an out parameter) is useful, it's mostly just annoying at the
application level, where you generally know that the CSS property is
going to specified, and there is no especially sane fallback if it's
not.

So rename the current methods to lookup_color, lookup_double, and
lookup_length, and add new get_color, get_double, and get_length
methods that don't take an "inherit" parameter, and return their
values directly. (Well, except for get_color, due to the lack of (out
caller-allocates) in gjs.)

And update the code to use either the old or new methods as appropriate.

https://bugzilla.gnome.org/show_bug.cgi?id=632590
2010-10-21 15:02:33 -04:00
Florian Müllner
627f1cb59a iconGrid: Add alignment parameter
Currently the grid's content is centered, which is not appropriate
for all use cases. Add an optional parameter to control the alignment.

https://bugzilla.gnome.org/show_bug.cgi?id=632147
2010-10-14 17:41:54 +02:00
Florian Müllner
9708b68540 [baseIcon] Tie the icon's width to its height
Both current design and new mockups use square icons. Currently this
is implemented by setting a fixed width and height in the CSS, which
does not work for the growing/shrinking items in the new sidebar.
By moving the assumption of square items into the code, the size will
adjust according to icon size, spacing, padding and font size if not
explicitly overwritten in the CSS.

https://bugzilla.gnome.org/show_bug.cgi?id=625887
2010-09-23 19:08:43 +02:00
Florian Müllner
01f4dc68b8 [baseIcon] Allow setting the icon size from code
The current design features a sidebar where the icon size shrinks
automatically to fit more items. Add a setSizeManually parameter
to BaseIcon, which disables sizes read from CSS and allows to use
BaseIcon.setIconSize() to support this.

https://bugzilla.gnome.org/show_bug.cgi?id=625887
2010-09-23 19:08:43 +02:00
Florian Müllner
8c1bf346a9 [appDisplay] Factor out WellGrid/AppIcon
All mockups now use a representation for documents/places similar to
the one used for applications. Rename AppIcon to BaseIcon and move its
code together with WellGrid out of appDisplay to stress their general
usefulness.

https://bugzilla.gnome.org/show_bug.cgi?id=625887
2010-09-23 19:08:43 +02:00