[longomatch] Add expanders back for lists in treeviews
- From: Andoni Morales Alastruey <amorales src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [longomatch] Add expanders back for lists in treeviews
- Date: Thu, 8 Jan 2015 10:59:38 +0000 (UTC)
commit 290ff51a96f1ca841f7194af6a66c3c6c3793e29
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date: Thu Jan 8 11:54:17 2015 +0100
Add expanders back for lists in treeviews
LongoMatch.Core/StyleConf.cs | 2 +
LongoMatch.Drawing/PlayslistCellRenderer.cs | 30 +++++++++--
data/icons/Makefile.am | 2 +
.../scalable/actions/longomatch-arrow-down.svg | 54 ++++++++++++++++++++
.../scalable/actions/longomatch-arrow-right.svg | 54 ++++++++++++++++++++
5 files changed, 138 insertions(+), 4 deletions(-)
---
diff --git a/LongoMatch.Core/StyleConf.cs b/LongoMatch.Core/StyleConf.cs
index cb5e0c2..6a39b4d 100644
--- a/LongoMatch.Core/StyleConf.cs
+++ b/LongoMatch.Core/StyleConf.cs
@@ -63,6 +63,8 @@ namespace LongoMatch.Core.Common
public const int ListEyeIconOffset = 10;
public const string ListEyeIconPath = "hicolor/scalable/actions/longomatch-eye.svg";
+ public const string ListArrowRightPath =
"hicolor/scalable/actions/longomatch-arrow-right.svg";
+ public const string ListArrowDownPath = "hicolor/scalable/actions/longomatch-arrow-down.svg";
public const int TeamsShieldIconSize = 45;
diff --git a/LongoMatch.Drawing/PlayslistCellRenderer.cs b/LongoMatch.Drawing/PlayslistCellRenderer.cs
index a914a8f..6435bfc 100644
--- a/LongoMatch.Drawing/PlayslistCellRenderer.cs
+++ b/LongoMatch.Drawing/PlayslistCellRenderer.cs
@@ -31,6 +31,8 @@ namespace LongoMatch.Drawing
{
public static ISurface EyeSurface = null;
+ public static ISurface ArrowRight = null;
+ public static ISurface ArrowDown = null;
public static Image subsImage = null;
public static void RenderSeparationLine (IDrawingToolkit tk, IContext context, Area
backgroundArea)
@@ -57,14 +59,34 @@ namespace LongoMatch.Drawing
po.Dispose ();
}
- static void RenderCount (Color color, int count, IDrawingToolkit tk, Area backgroundArea,
Area cellArea)
+ static void RenderCount(bool isExpanded, Color color, int count, IDrawingToolkit tk, Area
backgroundArea, Area cellArea)
{
double countX1, countX2, countY, countYC;
+ Point arrowY;
+ ISurface arrow;
countX1 = cellArea.Start.X + StyleConf.ListRowSeparator + StyleConf.ListCountRadio;
countX2 = countX1 + StyleConf.ListCountWidth;
countYC = backgroundArea.Start.Y + backgroundArea.Height / 2;
countY = countYC - StyleConf.ListCountRadio;
+ if (!isExpanded) {
+ if (ArrowRight == null) {
+ ArrowRight = Config.DrawingToolkit.CreateSurface (Path.Combine
(Config.IconsDir,
+
StyleConf.ListArrowRightPath));
+ }
+ arrow = ArrowRight;
+ arrowY = new Point (cellArea.Start.X + 1,
+ cellArea.Start.Y + cellArea.Height / 2 - arrow.Height /
2);
+ } else {
+ if (ArrowDown == null) {
+ ArrowDown = Config.DrawingToolkit.CreateSurface (Path.Combine
(Config.IconsDir,
+
StyleConf.ListArrowDownPath));
+ }
+ arrow = ArrowDown;
+ arrowY = new Point (cellArea.Start.X + 1, cellArea.Start.Y + cellArea.Height
/ 2);
+ }
+ tk.DrawSurface (arrow, arrowY);
+
tk.LineWidth = 0;
tk.FillColor = color;
tk.DrawCircle (new Point (countX1, countYC), StyleConf.ListCountRadio);
@@ -118,7 +140,7 @@ namespace LongoMatch.Drawing
RenderBackgroundAndText (isExpanded, tk, backgroundArea, text, textWidth,
player.ToString ());
/* Photo */
RenderPlayer (tk, player, image);
- RenderCount (player.Color, count, tk, backgroundArea, cellArea);
+ RenderCount (isExpanded, player.Color, count, tk, backgroundArea, cellArea);
RenderSeparationLine (tk, context, backgroundArea);
tk.End ();
}
@@ -130,7 +152,7 @@ namespace LongoMatch.Drawing
tk.Context = context;
tk.Begin ();
RenderBackgroundAndText (isExpanded, tk, backgroundArea, textP, cellArea.Width -
textP.X, playlist.Name);
- RenderCount (Config.Style.PaletteActive, count, tk, backgroundArea, cellArea);
+ RenderCount (isExpanded, Config.Style.PaletteActive, count, tk, backgroundArea,
cellArea);
RenderSeparationLine (tk, context, backgroundArea);
tk.End ();
}
@@ -142,7 +164,7 @@ namespace LongoMatch.Drawing
tk.Context = context;
tk.Begin ();
RenderBackgroundAndText (isExpanded, tk, backgroundArea, textP , cellArea.Width -
textP.X, cat.Name);
- RenderCount (cat.Color, count, tk, backgroundArea, cellArea);
+ RenderCount (isExpanded, cat.Color, count, tk, backgroundArea, cellArea);
RenderSeparationLine (tk, context, backgroundArea);
tk.End ();
}
diff --git a/data/icons/Makefile.am b/data/icons/Makefile.am
index 981d038..fef4b7b 100644
--- a/data/icons/Makefile.am
+++ b/data/icons/Makefile.am
@@ -5,6 +5,8 @@ nobase_dist_icons_DATA = Makefile.am \
hicolor/scalable/actions/longomatch-angle.svg \
hicolor/scalable/actions/longomatch-apply-button.svg \
hicolor/scalable/actions/longomatch-apply.svg \
+ hicolor/scalable/actions/longomatch-arrow-down.svg \
+ hicolor/scalable/actions/longomatch-arrow-right.svg \
hicolor/scalable/actions/longomatch-arrow.svg \
hicolor/scalable/actions/longomatch-back.svg \
hicolor/scalable/actions/longomatch-browse.svg \
diff --git a/data/icons/hicolor/scalable/actions/longomatch-arrow-down.svg
b/data/icons/hicolor/scalable/actions/longomatch-arrow-down.svg
new file mode 100644
index 0000000..7be5ccc
--- /dev/null
+++ b/data/icons/hicolor/scalable/actions/longomatch-arrow-down.svg
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ version="1.1"
+ id="Layer_1"
+ x="0px"
+ y="0px"
+ width="8"
+ height="6"
+ viewBox="3 -2 8 6"
+ enable-background="new 3 -2 28 28"
+ xml:space="preserve"
+ inkscape:version="0.48.4 r9939"
+ sodipodi:docname="longomatch-arrow-down.svg"><metadata
+ id="metadata9"><rdf:RDF><cc:Work
+ rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title
/></cc:Work></rdf:RDF></metadata><defs
+ id="defs7" /><sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1600"
+ inkscape:window-height="845"
+ id="namedview5"
+ showgrid="false"
+ inkscape:zoom="100.9122"
+ inkscape:cx="11.842344"
+ inkscape:cy="7.53786"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="Layer_1"
+ fit-margin-top="0"
+ fit-margin-left="0"
+ fit-margin-right="0"
+ fit-margin-bottom="0" /><polygon
+ clip-rule="evenodd"
+ points="4,23.305 4,0.695 30,12 "
+ id="polygon3"
+ transform="matrix(0,0.23076923,-0.35382574,0,11.245909,-2.9230769)"
+ style="fill:#50b44d;fill-opacity:0.94117647;fill-rule:evenodd" /></svg>
\ No newline at end of file
diff --git a/data/icons/hicolor/scalable/actions/longomatch-arrow-right.svg
b/data/icons/hicolor/scalable/actions/longomatch-arrow-right.svg
new file mode 100644
index 0000000..9b6ef9b
--- /dev/null
+++ b/data/icons/hicolor/scalable/actions/longomatch-arrow-right.svg
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ version="1.1"
+ id="Layer_1"
+ x="0px"
+ y="0px"
+ width="6"
+ height="8"
+ viewBox="3 -2 6 8"
+ enable-background="new 3 -2 28 28"
+ xml:space="preserve"
+ inkscape:version="0.48.4 r9939"
+ sodipodi:docname="longomatch-arrow-right.svg"><metadata
+ id="metadata9"><rdf:RDF><cc:Work
+ rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title
/></cc:Work></rdf:RDF></metadata><defs
+ id="defs7" /><sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1600"
+ inkscape:window-height="845"
+ id="namedview5"
+ showgrid="false"
+ inkscape:zoom="100.9122"
+ inkscape:cx="4.7074289"
+ inkscape:cy="7.53786"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="Layer_1"
+ fit-margin-top="0"
+ fit-margin-left="0"
+ fit-margin-right="0"
+ fit-margin-bottom="0" /><polygon
+ clip-rule="evenodd"
+ points="4,23.305 4,0.695 30,12 "
+ id="polygon3"
+ transform="matrix(0.23076923,0,0,0.35382574,2.0769231,-2.2459089)"
+ style="fill:#50b44d;fill-opacity:0.94117647;fill-rule:evenodd" /></svg>
\ No newline at end of file
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]