Browse Source

Fixes #3430

(Remove randomness from VaadinTunes) and #3389
(Visual regression in ToolkitTunes)

svn changeset:9077/svn branch:6.2
tags/6.7.0.beta1
Jouni Koivuviita 14 years ago
parent
commit
d503ebe89b

+ 4
- 4
WebContent/VAADIN/themes/vaadintunes/styles.css View File

} }


/* Hide all button captions */ /* Hide all button captions */
.tTunes .top .v-button span {
.tTunes .top .v-nativebutton span {
display: none; display: none;
} }


.tTunes .playback .v-button {
.tTunes .playback .v-nativebutton {
width: 31px; width: 31px;
height: 32px; height: 32px;
overflow: hidden; overflow: hidden;
text-shadow: #fff 0 1px 0; text-shadow: #fff 0 1px 0;
} }


.tTunes .sidebar .v-button {
.tTunes .sidebar .v-nativebutton {
text-align: left; text-align: left;
border: none; border: none;
background: transparent; background: transparent;
padding: 2px 0; padding: 2px 0;
} }


.tTunes .sidebar .v-button span {
.tTunes .sidebar .v-nativebutton span {
padding-left: 25px; padding-left: 25px;
} }



+ 23
- 25
src/com/vaadin/demo/VaadinTunesLayout.java View File

package com.vaadin.demo; package com.vaadin.demo;


import java.util.Random;

import com.vaadin.Application; import com.vaadin.Application;
import com.vaadin.terminal.ThemeResource; import com.vaadin.terminal.ThemeResource;
import com.vaadin.ui.Button; import com.vaadin.ui.Button;
import com.vaadin.ui.Embedded; import com.vaadin.ui.Embedded;
import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label; import com.vaadin.ui.Label;
import com.vaadin.ui.NativeButton;
import com.vaadin.ui.NativeSelect; import com.vaadin.ui.NativeSelect;
import com.vaadin.ui.Slider; import com.vaadin.ui.Slider;
import com.vaadin.ui.SplitPanel; import com.vaadin.ui.SplitPanel;
top.setExpandRatio(status, 1.0F); top.setExpandRatio(status, 1.0F);


// Playback controls // Playback controls
Button prev = new Button("Previous");
Button play = new Button("Play/pause");
Button next = new Button("Next");
Button prev = new NativeButton("Previous");
Button play = new NativeButton("Play/pause");
Button next = new NativeButton("Next");
playback.addComponent(prev); playback.addComponent(prev);
playback.addComponent(play); playback.addComponent(play);
playback.addComponent(next); playback.addComponent(next);
playback.setSpacing(true); playback.setSpacing(true);


// Volume controls // Volume controls
Button mute = new Button("mute");
Button mute = new NativeButton("mute");
Slider vol = new Slider(); Slider vol = new Slider();
vol.setOrientation(Slider.ORIENTATION_HORIZONTAL); vol.setOrientation(Slider.ORIENTATION_HORIZONTAL);
vol.setWidth("100px"); vol.setWidth("100px");
Button max = new Button("max");
Button max = new NativeButton("max");
volume.addComponent(mute); volume.addComponent(mute);
volume.addComponent(vol); volume.addComponent(vol);
volume.addComponent(max); volume.addComponent(max);
status.setWidth("80%"); status.setWidth("80%");
status.setSpacing(true); status.setSpacing(true);


Button toggleVisualization = new Button("Mode");
Button toggleVisualization = new NativeButton("Mode");
Label timeFromStart = new Label("0:00"); Label timeFromStart = new Label("0:00");


// We'll need another layout to show currently playing track and // We'll need another layout to show currently playing track and
trackDetails.setComponentAlignment(album, "center"); trackDetails.setComponentAlignment(album, "center");


Label timeToEnd = new Label("-4:46"); Label timeToEnd = new Label("-4:46");
Button jumpToTrack = new Button("Show");
Button jumpToTrack = new NativeButton("Show");


// Place all components to the status layout and align them properly // Place all components to the status layout and align them properly
status.addComponent(toggleVisualization); status.addComponent(toggleVisualization);
status.setExpandRatio(trackDetails, 1.0F); status.setExpandRatio(trackDetails, 1.0F);


// View mode buttons // View mode buttons
Button viewAsTable = new Button("Table");
Button viewAsGrid = new Button("Grid");
Button coverflow = new Button("Coverflow");
Button viewAsTable = new NativeButton("Table");
Button viewAsGrid = new NativeButton("Grid");
Button coverflow = new NativeButton("Coverflow");
viewmodes.addComponent(viewAsTable); viewmodes.addComponent(viewAsTable);
viewmodes.addComponent(viewAsGrid); viewmodes.addComponent(viewAsGrid);
viewmodes.addComponent(coverflow); viewmodes.addComponent(coverflow);
*/ */
VerticalLayout selections = new VerticalLayout(); VerticalLayout selections = new VerticalLayout();
Label library = new Label("Library"); Label library = new Label("Library");
Button music = new Button("Music");
Button music = new NativeButton("Music");
music.setWidth("100%"); music.setWidth("100%");


Label store = new Label("Store"); Label store = new Label("Store");
Button vaadinTunesStore = new Button("VaadinTunes Store");
Button vaadinTunesStore = new NativeButton("VaadinTunes Store");
vaadinTunesStore.setWidth("100%"); vaadinTunesStore.setWidth("100%");
Button purchased = new Button("Purchased");
Button purchased = new NativeButton("Purchased");
purchased.setWidth("100%"); purchased.setWidth("100%");


Label playlists = new Label("Playlists"); Label playlists = new Label("Playlists");
Button genius = new Button("Geniues");
Button genius = new NativeButton("Geniues");
genius.setWidth("100%"); genius.setWidth("100%");
Button recent = new Button("Recently Added");
Button recent = new NativeButton("Recently Added");
recent.setWidth("100%"); recent.setWidth("100%");


// Lets add them to the 'selections' layout // Lets add them to the 'selections' layout
"Frames", "Fortress", "Phobia", "The Poison", "Manifesto", "Frames", "Fortress", "Phobia", "The Poison", "Manifesto",
"White Pony", "The Big Dirty" }; "White Pony", "The Big Dirty" };
String[] genres = new String[] { "Rock", "Metal", "Hardcore", "Indie", String[] genres = new String[] { "Rock", "Metal", "Hardcore", "Indie",
"Pop", "Alternative", "Blues", "Jazz", "Hip Hop", "Electronica" };
"Pop", "Alternative", "Blues", "Jazz", "Hip Hop",
"Electronica", "Punk", "Hard Rock", "Dance", "R'n'B", "Gospel",
"Country" };
for (int i = 0; i < 1000; i++) { for (int i = 0; i < 1000; i++) {
NativeSelect s = new NativeSelect(); NativeSelect s = new NativeSelect();
s.addItem("1 star"); s.addItem("1 star");
s.addItem("3 stars"); s.addItem("3 stars");
s.addItem("4 stars"); s.addItem("4 stars");
s.addItem("5 stars"); s.addItem("5 stars");
s.select(new Random().nextInt(5) + " stars");
listing.addItem(new Object[] {
tracks[new Random().nextInt(tracks.length - 1)],
times[new Random().nextInt(times.length - 1)],
artists[new Random().nextInt(artists.length - 1)],
albums[new Random().nextInt(albums.length - 1)],
genres[new Random().nextInt(genres.length - 1)], s }, i);
s.select(i % 5 + " stars");
final int index = i % 16;
listing.addItem(new Object[] { tracks[index], times[index],
artists[index], albums[index], genres[index], s }, i);
} }


// We'll align the track time column to right as well // We'll align the track time column to right as well

Loading…
Cancel
Save