Skip to content

Commit

Permalink
Add legal wallpapers, and part of images used by buttons.
Browse files Browse the repository at this point in the history
  • Loading branch information
DaveDavenport committed Feb 21, 2011
1 parent 581bbc3 commit 4fec9d6
Show file tree
Hide file tree
Showing 17 changed files with 2,218 additions and 4,093 deletions.
Binary file added Data/button.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Data/button_pressed.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Data/header.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Data/player_control.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6,195 changes: 2,162 additions & 4,033 deletions Mockup/drawing.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 7 additions & 3 deletions SRC/Views/BackgroundDrawer.vala
Expand Up @@ -52,14 +52,17 @@ class BackgroundDrawer : SDLWidget, SDLWidgetDrawing
this.y = y;
this.w = w;
this.h = h;
var regex = new Regex (".*\\.png$");

/* */
try{
GLib.Dir a = GLib.Dir.open(directory);
for(var file = a.read_name(); file != null; file = a.read_name())
{
backgrounds.append(file);
}
if(regex.match(file)) {
backgrounds.append(file);
}
}
}catch (GLib.Error e)
{

Expand All @@ -72,7 +75,8 @@ class BackgroundDrawer : SDLWidget, SDLWidgetDrawing
/* Failsafe */
sf = SDLImage.load("test.png");
}
sf = sf.DisplayFormat();
if(sf != null)
sf = sf.DisplayFormat();
this.require_redraw = true;
}

Expand Down
22 changes: 12 additions & 10 deletions SRC/Views/Header.vala
Expand Up @@ -66,22 +66,24 @@ class Header : SDLWidget, SDLWidgetDrawing
this.x = x; this.y = y; this.w = w; this.h = h;

/* Create surface */
sf = new Surface.RGB(0, w,h,bpp,(uint32)0xFF000000, 0x00FF0000, 0x0000FF00, 0x000000FF);
sf = sf.DisplayFormatAlpha();
// sf = new Surface.RGB(0, w,h,bpp,(uint32)0xFF000000, 0x00FF0000, 0x0000FF00, 0x000000FF);

/* Draw background */
sf = SDLImage.load("Data/header.png");
sf = sf.DisplayFormat();

/* Draw background /
SDL.Rect rect = {0,0,(uint16)sf.w,(uint16)sf.h};
sf.fill(rect, sf.format.map_rgba(0,0,0,200));
SDL.Rect rect_line = {0,(int16)(this.h-2), (uint16)w, 2};
sf.fill(rect_line, sf.format.map_rgba(255,255,255,255));

/* Quit button */
*/
/* Quit button */
quit_button = new SDLMpc.Button(m,
(int16) this.x,
(int16) this.y,
(uint16)this.h-2,
(uint16)this.h-2,
(uint16)this.h,
(uint16)this.h,
"Q");
this.children.append(quit_button);
quit_button.b_clicked.connect((source) => {
Expand All @@ -93,10 +95,10 @@ class Header : SDLWidget, SDLWidgetDrawing


/* Up button */
up_button = new SDLMpc.Button(m, (int16) (this.x+(this.w-this.h+2)),
up_button = new SDLMpc.Button(m, (int16) (this.x+(this.w-this.h)),
(int16) this.y,
(uint16)this.h-2,
(uint16)this.h-2,
(uint16)this.h,
(uint16)this.h,
"U");
this.children.append(up_button);
up_button.b_clicked.connect((source) => {
Expand Down
52 changes: 13 additions & 39 deletions SRC/Views/NowPlaying.vala
Expand Up @@ -68,9 +68,9 @@ class NowPlaying : SDLWidget, SDLWidgetDrawing

var frame = new PlayerControl (this.m,
(int16) this.x,
(int16) (this.y+this.h-42),
(int16) (this.y+this.h-38),
(uint16) this.w,
42,
38,
bpp);
this.children.append(frame);

Expand Down Expand Up @@ -513,7 +513,6 @@ class PlayerControl : SDLWidget, SDLWidgetDrawing

private VolumeBar volume_bar;

private bool pressed = false;
private bool stopped = false;


Expand All @@ -528,20 +527,23 @@ class PlayerControl : SDLWidget, SDLWidgetDrawing

this.x = x; this.y = y; this.w = w; this.h = h;


/*
sf = new Surface.RGB(0, w,h,bpp,(uint32)0xFF000000, 0x00FF0000, 0x0000FF00, 0x000000FF);
sf = sf.DisplayFormatAlpha();

*/
sf = SDLImage.load("Data/player_control.png");
sf = sf.DisplayFormat();
/*
SDL.Rect rect = {0,0,(uint16)sf.w,(uint16)sf.h};
rect.h = (uint16)this.h;
if(pressed) {
sf.fill(rect, sf.format.map_rgba(200,30,30,128));
}else{
sf.fill(rect, sf.format.map_rgba(30,30,30,128));
}

*/
/* Previous button */
prev_button = new SDLMpc.Button(m, (int16) this.x+ 1,(int16) this.y+1, 50, 40, "◂◂");
prev_button = new SDLMpc.Button(m, (int16) this.x+ 0,(int16) this.y+0, 38, 38, "◂◂");
prev_button.b_clicked.connect((source) => {
SDLMpc.Event ev = new SDLMpc.Event();
ev.type = SDLMpc.EventType.COMMANDS;
Expand All @@ -551,7 +553,7 @@ class PlayerControl : SDLWidget, SDLWidgetDrawing


/* Stop button */
stop_button = new SDLMpc.Button(m, (int16) this.x+ 52,(int16) this.y+1, 50, 40, "");
stop_button = new SDLMpc.Button(m, (int16) this.x+ 38,(int16) this.y+0, 38, 38, "");
stop_button.b_clicked.connect((source) => {
SDLMpc.Event ev = new SDLMpc.Event();
ev.type = SDLMpc.EventType.COMMANDS;
Expand All @@ -562,7 +564,7 @@ class PlayerControl : SDLWidget, SDLWidgetDrawing


/* Play/pause button */
pause_button = new SDLMpc.Button(m,(int16) this.x+ 103,(int16) this.y+1, 50, 40, "");
pause_button = new SDLMpc.Button(m,(int16) this.x+ 76,(int16) this.y+0, 38, 38, "");
pause_button.b_clicked.connect((source) => {
SDLMpc.Event ev = new SDLMpc.Event();
ev.type = SDLMpc.EventType.COMMANDS;
Expand All @@ -573,7 +575,7 @@ class PlayerControl : SDLWidget, SDLWidgetDrawing
}
m.push_event((owned)ev);
});
next_button = new SDLMpc.Button(m, (int16) this.x+ 154,(int16) this.y+1, 50, 40, "▸▸");
next_button = new SDLMpc.Button(m, (int16) this.x+ 114,(int16) this.y+0, 38, 38, "▸▸");
next_button.b_clicked.connect((source) => {
SDLMpc.Event ev = new SDLMpc.Event();
ev.type = SDLMpc.EventType.COMMANDS;
Expand All @@ -594,7 +596,7 @@ class PlayerControl : SDLWidget, SDLWidgetDrawing
}
});

volume_bar = new VolumeBar(m, (int16) this.x+ 300,(int16) this.y+10,(uint16)(this.w-300), 20);
volume_bar = new VolumeBar(m, (int16) this.x+ 280,(int16) this.y+10,(uint16)(this.w-300), 20);

this.children.append(prev_button);
this.children.append(stop_button);
Expand All @@ -620,34 +622,6 @@ class PlayerControl : SDLWidget, SDLWidgetDrawing

sf.blit_surface(src_rect, screen, dest_rect);
}
public override bool button_press()
{
if(!pressed)
{
SDL.Rect rect = {0,0,(uint16)this.w,(uint16)this.h};
GLib.debug("PlayerControl bg press");
pressed =true;
sf.fill(rect, sf.format.map_rgba(200,30,30,128));
this.require_redraw = true;;
return true;
}
return false;
}
public override void button_release(bool inside)
{
if(pressed) {
SDL.Rect rect = {0,0,(uint16)this.w,(uint16)this.h};
GLib.debug("PlayerControl bg release");
sf.fill(rect, sf.format.map_rgba(30,30,30,128));
pressed = false;

if(inside) {
/* Button release */

}
this.require_redraw = true;;
}
}


/**
Expand Down
27 changes: 19 additions & 8 deletions SRC/Widgets/SDLMpcButton.vala
Expand Up @@ -32,6 +32,7 @@ namespace SDLMpc
private Main m;
public Label l;
private Surface sf;
private Surface sf_pressed;
private bool pressed = false;
private bool highlight = false;

Expand All @@ -57,8 +58,8 @@ namespace SDLMpc

public void update()
{
SDL.Rect rect = {0,0,(uint16)sf.w,(uint16)sf.h};

SDL.Rect rect = {0,0,(uint16)this.w,(uint16)this.h};
/*
if(highlight){
sf.fill(rect, sf.format.map_rgba(0,255,255,170));
}else{
Expand All @@ -70,10 +71,11 @@ namespace SDLMpc
}else {
sf.fill(rect, sf.format.map_rgba(0,0,0,170));
}
l.x = (int16)(this.x+ ((sf.w -l.width())*_x_align)+1);
l.y = (int16)(this.y+ (sf.h-l.height())/2);
l.x = (int16)(this.x+ ((this.w -l.width())*_x_align)+1);
l.y = (int16)(this.y+ (this.h-l.height())/2);
l.w = (uint16)(this.w-(l.x-this.x))-1;
l.h = (uint16)(this.h-(l.y-this.y))-1;
*/
this.l.require_redraw = true;;
}
public void update_text(string? text)
Expand All @@ -94,8 +96,12 @@ namespace SDLMpc
this.h = height;


sf = new Surface.RGB(0, width,height,32,(uint32)0xFF000000, 0x00FF0000, 0x0000FF00, 0x000000FF);
sf = sf.DisplayFormatAlpha();
//sf = new Surface.RGB(0, width,height,32,(uint32)0xFF000000, 0x00FF0000, 0x0000FF00, 0x000000FF);

sf = SDLImage.load("Data/button.png");
sf = sf.DisplayFormatAlpha();
sf_pressed = SDLImage.load("Data/button_pressed.png");
sf_pressed = sf_pressed.DisplayFormatAlpha();
if(height < 30) {
l = new Label(m, FontSize.SMALL,(int16)this.x+2,(int16)this.y+2,(uint16)w-4,(uint16)h-4);
}else{
Expand Down Expand Up @@ -124,7 +130,12 @@ namespace SDLMpc
src_rect.h = (uint16).min((uint16)this.h, (uint16)(orect.y+orect.h-this.y));
GLib.debug("rect: %i %i %u %u", src_rect.x, src_rect.y, src_rect.w, src_rect.h);
// {(int16)this.x,(int16) this.y,(uint16)this.w,(uint16) this.h};
sf.blit_surface(src_rect, screen, dest_rect);
if(pressed)
{
sf_pressed.blit_surface(src_rect, screen, dest_rect);
}else{
sf.blit_surface(src_rect, screen, dest_rect);
}
}

public override bool button_press()
Expand All @@ -142,7 +153,7 @@ namespace SDLMpc
{
if(pressed) {
SDL.Rect rect = {0,0,(uint16)this.w,(uint16)this.h};
sf.fill(rect, sf.format.map_rgba(30,30,30,128));
//sf.fill(rect, sf.format.map_rgba(30,30,30,128));
pressed = false;

if(inside) {
Expand Down
Binary file modified Wallpapers/1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed Wallpapers/2.jpg
Binary file not shown.
Binary file added Wallpapers/2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed Wallpapers/3.jpg
Binary file not shown.
Binary file added Wallpapers/3.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed Wallpapers/4.jpg
Binary file not shown.
Binary file modified Wallpapers/5.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions Wallpapers/ART
@@ -0,0 +1,5 @@
1 - Fantasy - Art by MrWonderful under the Creative Commons by-nc-nd
2 - Abyss - Art by MrWonderful under the Creative Commons by-nc-nd
3 - Dash - Art by MrWonderful under the Creative Commons by-nc-nd
5 - Escape - Art by MrWonderful under the Creative Commons by-nc-nd

0 comments on commit 4fec9d6

Please sign in to comment.