Skip to content

Commit

Permalink
Allow style switch in read only, fix Neo buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
SusanRatiLane authored and jisqyv committed Jul 12, 2024
1 parent 32b7850 commit 2eb3105
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,15 +121,16 @@

<!-- Settings Menu -->
<ai:DropDownButton name="Settings" caption="{messages.settingsTabName}"
styleName="ode-TopPanelButton" ui:field="settingsDropDown"
visible="{hasWriteAccess}">
styleName="ode-TopPanelButton" ui:field="settingsDropDown">
<ai:DropDownItem name="UISettings" caption="{messages.uiSettings}">
<actions:UISettingsAction/>
</ai:DropDownItem>
<ai:DropDownItem name="AutoloadLastProject" caption="{messages.disableAutoload}">
<ai:DropDownItem name="AutoloadLastProject" caption="{messages.disableAutoload}"
visible="{hasWriteAccess}">
<actions:DisableAutoloadAction/>
</ai:DropDownItem>
<ai:DropDownItem name="DyslexicFont" caption="{messages.disableOpenDyslexic}">
<ai:DropDownItem name="DyslexicFont" caption="{messages.disableOpenDyslexic}"
visible="{hasWriteAccess}">
<actions:SetFontRegularAction/>
</ai:DropDownItem>
</ai:DropDownButton>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ interface ProjectToolbarUiBinder extends UiBinder<Toolbar, ProjectToolbar> {}
private static final String WIDGET_NAME_LOGINTOGALLERY = "Login to Gallery";

private final boolean isReadOnly;
private final boolean isGalleryReadyOnly;
private final boolean galleryEnabled;
@UiField protected Label projectLabel;
@UiField protected Label trashLabel;
Expand All @@ -48,12 +49,13 @@ interface ProjectToolbarUiBinder extends UiBinder<Toolbar, ProjectToolbar> {}
public ProjectToolbar() {
super();
isReadOnly = Ode.getInstance().isReadOnly();
isGalleryReadyOnly = Ode.getInstance().getGalleryReadOnly();
// Is the new gallery enabled
galleryEnabled = Ode.getSystemConfig().getGalleryEnabled();
bindProjectToolbar();
if (galleryEnabled) {
setButtonVisible(WIDGET_NAME_LOGINTOGALLERY, true);
if (!Ode.getInstance().getGalleryReadOnly()) {
if (!isGalleryReadyOnly) {
setButtonVisible(WIDGET_NAME_SENDTONG, true);
}
}
Expand Down Expand Up @@ -85,7 +87,8 @@ public void setProjectTabButtonsVisible(boolean visible) {
setButtonVisible("ImportProject", visible);
setButtonVisible("ImportTemplate", visible);
setButtonVisible("Move", visible);
setButtonVisible("Publish", visible);
setButtonVisible(WIDGET_NAME_SENDTONG, visible && galleryEnabled && !isGalleryReadyOnly);
setButtonVisible(WIDGET_NAME_LOGINTOGALLERY, visible && galleryEnabled);
setDropDownButtonVisible("Export", visible);
projectLabel.setVisible(visible);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@
<ca:SwitchToProjectAction/>
</ai:ToolbarItem>
<g:Label ui:field="projectNameLabel" styleName="ya-ProjectName"/>
<ai:ToolbarItem name="TutorialToggle" caption="{messages.toggleTutorialButton}"
visible="false">
<ya:ToggleTutorialAction/>
</ai:ToolbarItem>

<ai:ToolbarItem styleName="ya-ProjectName" caption="Screens: " align="center" enabled="false"/>
<ai:DropDownButton name="ScreensDropdown" caption="{messages.screensButton}"
Expand All @@ -37,6 +33,11 @@
<ya:RemoveFormAction/>
</ai:ToolbarItem>

<ai:ToolbarItem name="TutorialToggle" icon="school" tooltip="{messages.toggleTutorialButton}"
visible="false" align="center" styleName="ode-ProjectListButton inline">
<ya:ToggleTutorialAction/>
</ai:ToolbarItem>

<ai:ToolbarItem name="ProjectPropertiesDialog" icon="manufacturing"
tooltip="{messages.projectPropertiesText}" align="center" styleName="ode-ProjectListButton inline left-spacer">
<ya:ProjectPropertiesAction />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,6 @@
tooltip="{messages.deleteFromTrashButton}">
<actions:DeleteForeverProjectAction/>
</ai:ToolbarItem>
<ai:ToolbarItem name="Send to Gallery" caption="{messages.publishToGalleryButton}" visible="false">
<actions:SendToGalleryAction/>
</ai:ToolbarItem>

</ai:Toolbar>
</ui:UiBinder>
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,16 @@

<!-- Settings Menu -->
<ai:DropDownButton name="Settings" styleName="ode-TopPanelButton"
ui:field="settingsDropDown" align="left" icon="settings"
visible="{hasWriteAccess}" caption="{messages.settingsTabName}">
ui:field="settingsDropDown" align="left" icon="settings" caption="{messages.settingsTabName}">
<ai:DropDownItem name="UISettings" caption="{messages.uiSettings}">
<actions:UISettingsAction/>
</ai:DropDownItem>
<ai:DropDownItem name="AutoloadLastProject" caption="{messages.disableAutoload}">
<ai:DropDownItem name="AutoloadLastProject" caption="{messages.disableAutoload}"
visible="{hasWriteAccess}" >
<actions:DisableAutoloadAction/>
</ai:DropDownItem>
<ai:DropDownItem name="DyslexicFont" caption="{messages.disableOpenDyslexic}">
<ai:DropDownItem name="DyslexicFont" caption="{messages.disableOpenDyslexic}"
visible="{hasWriteAccess}" >
<actions:SetFontRegularAction/>
</ai:DropDownItem>
<hr/>
Expand Down

0 comments on commit 2eb3105

Please sign in to comment.