Skip to content

Commit

Permalink
move navigation controls out of deck
Browse files Browse the repository at this point in the history
  • Loading branch information
jjallaire committed Jan 30, 2013
1 parent 8a23a5f commit 5ae49e4
Show file tree
Hide file tree
Showing 9 changed files with 49 additions and 26 deletions.
25 changes: 1 addition & 24 deletions src/cpp/session/resources/learning/slides.css
Original file line number Diff line number Diff line change
Expand Up @@ -46,29 +46,6 @@
color: blue;
}

.reveal .controls {
right: -20px;
bottom: 5px;
}

.reveal .controls div.navigate-left {
top: 75px;
}

.reveal .controls div.navigate-right {
left: 54px;
top: 75px;
}


.reveal .controls div.navigate-up {
display: none;
}

.reveal .controls div.navigate-down {
display: none;
}

.reveal .slides {
left: 48%;
}
Expand All @@ -79,7 +56,7 @@
}

.reveal video {
height: 75%;
height: 80%;
width: 100%;
}

Expand Down
2 changes: 1 addition & 1 deletion src/cpp/session/resources/learning/slides.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
#!slides_js#

Reveal.initialize({
controls: true,
controls: false,
progress: true,
history: true,
overview: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,14 @@ well as menu structures (for main menu and popup menus).
<cmd id="refreshLearning"
desc="Refresh the presentation"/>
<cmd id="learningFullscreen"
desc="Show slides in full screen mode"/>
desc="Show slides in full screen mode"/>

<cmd id="learningHome"
desc="Go to the first slide"/>
<cmd id="learningNext"
desc="Go to the next slide"/>
<cmd id="learningPrev"
desc="Go to the previous slide"/>

<cmd id="historySendToSource"
menuLabel="Insert into _Source"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,9 @@
// Learning
public abstract AppCommand refreshLearning();
public abstract AppCommand learningFullscreen();
public abstract AppCommand learningHome();
public abstract AppCommand learningNext();
public abstract AppCommand learningPrev();

// View
public abstract AppCommand showToolbar();
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ public LearningPane(Commands commands,
protected Toolbar createMainToolbar()
{
Toolbar toolbar = new Toolbar();

toolbar.addLeftWidget(commands_.learningHome().createToolbarButton());
toolbar.addLeftSeparator();
toolbar.addLeftWidget(commands_.learningPrev().createToolbarButton());
toolbar.addLeftWidget(commands_.learningNext().createToolbarButton());
toolbar.addLeftSeparator();

titleLabel_ = new ToolbarLabel();
toolbar.addLeftWidget(titleLabel_);

Expand Down Expand Up @@ -130,6 +137,12 @@ public static final native void enterFullscreen(WindowEx window) /*-{
return window.revealEnterFullscreen();
}-*/;

@Override
public void home()
{
Reveal.fromWindow(frame_.getWindow()).home();
}

@Override
public void next()
{
Expand All @@ -153,6 +166,10 @@ public static final native Reveal fromWindow(WindowEx window) /*-{
return window.Reveal;
}-*/;

public final native void home() /*-{
this.slide(0);
}-*/;

public final native void next() /*-{
this.next();
}-*/;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public interface Display extends WorkbenchView
{
void load(String url, LearningState state);
boolean hasSlides();
void home();
void next();
void prev();
void fullScreen();
Expand Down Expand Up @@ -144,6 +145,24 @@ public void onShowLearningPane(ShowLearningPaneEvent event)
}
}

@Handler
void onLearningHome()
{
view_.home();
}

@Handler
void onLearningNext()
{
view_.next();
}

@Handler
void onLearningPrev()
{
view_.prev();
}

@Handler
void onLearningFullscreen()
{
Expand Down

0 comments on commit 5ae49e4

Please sign in to comment.