Skip to content

Commit

Permalink
learning full-screen command
Browse files Browse the repository at this point in the history
  • Loading branch information
jjallaire committed Jan 30, 2013
1 parent e09f131 commit 543579f
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 10 deletions.
9 changes: 0 additions & 9 deletions src/cpp/session/resources/learning/slides.js
Expand Up @@ -82,12 +82,3 @@ function revealEnterFullscreen() {
}
}

// alt-click to zoom
(function(){
document.querySelector('.reveal').addEventListener('click',
function( event ) {
if (event.altKey) {
event.preventDefault();
revealEnterFullscreen();
}
});
Expand Up @@ -907,7 +907,8 @@ well as menu structures (for main menu and popup menus).
<!-- Learning -->
<cmd id="refreshLearning"
desc="Refresh the presentation"/>

<cmd id="learningFullscreen"
desc="Show slides in full screen mode"/>

<cmd id="historySendToSource"
menuLabel="Insert into _Source"
Expand Down
Expand Up @@ -159,6 +159,7 @@

// Learning
public abstract AppCommand refreshLearning();
public abstract AppCommand learningFullscreen();

// View
public abstract AppCommand showToolbar();
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Expand Up @@ -52,6 +52,8 @@ protected Toolbar createMainToolbar()
titleLabel_ = new ToolbarLabel();
toolbar.addLeftWidget(titleLabel_);

toolbar.addRightWidget(commands_.learningFullscreen().createToolbarButton());
toolbar.addRightSeparator();
toolbar.addRightWidget(commands_.refreshLearning().createToolbarButton());

return toolbar;
Expand Down Expand Up @@ -110,12 +112,24 @@ public boolean hasSlides()
return !"about:blank".equals(href);
}



@Override
public void refresh(boolean resetAnchor)
{
frame_.reload(resetAnchor);
}

@Override
public void fullScreen()
{
enterFullscreen(frame_.getWindow());
}

public static final native void enterFullscreen(WindowEx window) /*-{
return window.revealEnterFullscreen();
}-*/;

@Override
public void next()
{
Expand Down
Expand Up @@ -66,6 +66,7 @@ public interface Display extends WorkbenchView
boolean hasSlides();
void next();
void prev();
void fullScreen();
void refresh(boolean resetAnchor);
}

Expand Down Expand Up @@ -142,6 +143,12 @@ public void onShowLearningPane(ShowLearningPaneEvent event)
}
}

@Handler
void onLearningFullscreen()
{
view_.fullScreen();
}

@Handler
void onRefreshLearning()
{
Expand Down

0 comments on commit 543579f

Please sign in to comment.