Commit a04aed34 authored by ellelili2025's avatar ellelili2025 Committed by Susan Rati Lane

Hided tooltips, context menus, text selections etc when navigating from block editor. (#1940)

Fixes #1140
parent d29bd59c
......@@ -31,6 +31,7 @@ import com.google.appinventor.client.editor.EditorManager;
import com.google.appinventor.client.editor.FileEditor;
import com.google.appinventor.client.editor.youngandroid.BlocklyPanel;
import com.google.appinventor.client.editor.youngandroid.TutorialPanel;
import com.google.appinventor.client.editor.youngandroid.YaBlocksEditor;
import com.google.appinventor.client.explorer.commands.ChainableCommand;
import com.google.appinventor.client.explorer.commands.CommandRegistry;
import com.google.appinventor.client.explorer.commands.SaveAllEditorsCommand;
......@@ -442,6 +443,7 @@ public class Ode implements EntryPoint {
public void switchToProjectsView() {
// We may need to pass the code below as a runnable to
// screenShotMaybe() so build the runnable now
hideChaff();
hideTutorials();
Runnable next = new Runnable() {
@Override
......@@ -483,6 +485,7 @@ public class Ode implements EntryPoint {
*/
public void switchToTrash() {
hideChaff();
hideTutorials();
if (currentView != TRASHCAN){
TrashProjectListBox.getTrashProjectListBox().getTrashProjectList().getSelectedProjects().clear();
......@@ -508,6 +511,7 @@ public class Ode implements EntryPoint {
*/
public void switchToUserAdminPanel() {
hideChaff();
hideTutorials();
currentView = USERADMIN;
deckPanel.showWidget(userAdminTabIndex);
......@@ -517,6 +521,7 @@ public class Ode implements EntryPoint {
* Switch to the Gallery tab
*/
public void switchToGalleryView() {
hideChaff();
hideTutorials();
if (!galleryInitialized) {
// Gallery initialization is deferred until now.
......@@ -530,6 +535,7 @@ public class Ode implements EntryPoint {
* Switch to the Gallery App
*/
public void switchToGalleryAppView(GalleryApp app, int editStatus) {
hideChaff();
hideTutorials();
if (!galleryInitialized) {
// Gallery initialization is deferred until now.
......@@ -545,6 +551,7 @@ public class Ode implements EntryPoint {
* TODO: change string parameter
*/
public void switchToUserProfileView(String userId, int editStatus) {
hideChaff();
hideTutorials();
currentView = USERPROFILE;
OdeLog.log("###########" + userId + "||||||" + editStatus);
......@@ -556,6 +563,7 @@ public class Ode implements EntryPoint {
* Switch to the Designer tab. Shows an error message if there is no currentFileEditor.
*/
public void switchToDesignView() {
hideChaff();
// Only show designer if there is a current editor.
// ***** THE DESIGNER TAB DOES NOT DISPLAY CORRECTLY IF THERE IS NO CURRENT EDITOR. *****
showTutorials();
......@@ -573,6 +581,7 @@ public class Ode implements EntryPoint {
* Switch to Gallery TabPanel
*/
public void switchToPrivateUserProfileView() {
hideChaff();
currentView = privateUserProfileIndex;
deckPanel.showWidget(privateUserProfileIndex);
}
......@@ -581,6 +590,7 @@ public class Ode implements EntryPoint {
* Switch to the Moderation Page tab
*/
public void switchToModerationPageView() {
hideChaff();
hideTutorials();
if (!galleryInitialized) {
initializeGallery();
......@@ -592,6 +602,7 @@ public class Ode implements EntryPoint {
* Switch to the Debugging tab
*/
public void switchToDebuggingView() {
hideChaff();
hideTutorials();
deckPanel.showWidget(debuggingTabIndex);
......@@ -1548,7 +1559,14 @@ public class Ode implements EntryPoint {
return getUserAutoloadProject();
}
/**
* HideChaff when switching view from block to others
*/
private void hideChaff() {
if (designToolbar.getCurrentView() == DesignToolbar.View.BLOCKS) {
currentFileEditor.hideChaff();
}
}
/**
* Returns user dyslexic font setting.
*
......
......@@ -174,4 +174,10 @@ public abstract class FileEditor extends Composite {
public void makeActiveWorkspace() {
}
/**
* YaBlockEditor will use Blockly.hideChaff to close tooltips, context menus etc.
*/
public void hideChaff() {
}
}
......@@ -641,6 +641,11 @@ public final class YaBlocksEditor extends FileEditor
blocksArea.hardReset();
}
/*
* Perform a hideChaff of Blockly
*/
public void hideChaff () {blocksArea.hideChaff();}
// Static Function. Find the associated editor for formName and
// set its "damaged" bit. This will cause the editor manager's scheduleAutoSave
// method to ignore this blocks file and not save it out.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment