Skip to content

Commit

Permalink
prevent selection of user interface elements
Browse files Browse the repository at this point in the history
  • Loading branch information
jjallaire committed Jul 12, 2012
1 parent 3ab09f7 commit 181be42
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -148,4 +148,6 @@ public interface ThemeStyles extends CssResource

String selectWidget();
String textBoxWithButton();

String selectableText();
}
11 changes: 11 additions & 0 deletions src/gwt/src/org/rstudio/core/client/theme/res/themeStyles.css
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ body {
body {
font-family: proportionalFont;
font-size: 12px;
-webkit-user-select: none;
}

select {
Expand All @@ -132,6 +133,16 @@ button, input[type="reset"], input[type="button"], input[type="submit"] {
.fixedWidthFont {
font-family: fixedWidthFont !important;
}

.gwt-Label {
cursor: default;
}

.selectableText {
-webkit-user-select: text;
cursor: text;
}

.gwt-DialogBox input[type=text] {
border: 1px solid #999;
height: 17px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
<ui:image field='StatusBarTile' src='images/StatusBarTile.png' />

<ui:style>
.pdfViewerPanel {
-webkit-user-select: auto;
}

.toolbarShadow {
position: fixed;
top: 0;
Expand Down Expand Up @@ -47,7 +51,7 @@
</ui:style>
<ui:with field="res" type="org.rstudio.core.client.theme.res.ThemeResources"/>

<g:HTMLPanel>
<g:HTMLPanel styleName="{style.pdfViewerPanel}">
<pdf:PDFViewerToolbar ui:field="toolbar_" />
<div class="{style.toolbarShadow}"></div>
<div id="controls" style="display: none">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@


import org.rstudio.core.client.prefs.PreferencesDialogBaseResources;
import org.rstudio.core.client.theme.res.ThemeStyles;
import org.rstudio.core.client.widget.MessageDialog;
import org.rstudio.core.client.widget.Operation;
import org.rstudio.core.client.widget.ProgressIndicator;
Expand Down Expand Up @@ -79,6 +80,7 @@ public void execute()

lblOrigin_ = new OriginLabel();
lblOrigin_.addStyleName(RES.styles().vcsOriginLabel());
lblOrigin_.addStyleName(ThemeStyles.INSTANCE.selectableText());
extraSpaced(lblOrigin_);
add(lblOrigin_);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
border: none;
white-space: pre-wrap !important;
margin: 0;
-webkit-user-select: text;
}
.output .command, .input {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
font-family: fixedWidthFont;
white-space: pre-wrap;
color: #888;
-webkit-user-select: auto;
}
.cellTableWidget > tbody > tr > td {
vertical-align: top;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import org.rstudio.core.client.Point;
import org.rstudio.core.client.StringUtil;
import org.rstudio.core.client.dom.DomUtils;
import org.rstudio.core.client.theme.res.ThemeStyles;
import org.rstudio.core.client.widget.ProgressPanel;
import org.rstudio.core.client.widget.images.ProgressImages;
import org.rstudio.studio.client.common.vcs.GitServerOperations.PatchMode;
Expand All @@ -51,6 +52,10 @@ public CommitDetail()
sizeWarning_.setVisible(false);
progressPanel_ = new ProgressPanel(ProgressImages.createLargeGray());
initWidget(GWT.<Binder>create(Binder.class).createAndBindUi(this));

ThemeStyles styles = ThemeStyles.INSTANCE;
labelId_.addStyleName(styles.selectableText());
labelParent_.addStyleName(styles.selectableText());
}

public void setIdDesc(String idDesc)
Expand Down

0 comments on commit 181be42

Please sign in to comment.