st-scroll-view: Add :overlay-scrollbars property
If enabled, scrollbars take away from the allocation given to the view's content. This is usually preferrable to painting the bars on top of the content, but there are exceptions, for instance when the content needs to be centered with regard to the view as a whole. Add a :overlay-scrollbars property to account for those cases. https://bugzilla.gnome.org/show_bug.cgi?id=694261
This commit is contained in:
@@ -339,6 +339,10 @@ function test() {
|
||||
let vfade = new St.Button({ label: 'No', style: 'text-decoration: underline; color: #4444ff;' });
|
||||
fadeBox.add(vfade);
|
||||
|
||||
fadeBox.add(new St.Label({ text: 'Overlay scrollbars: '}));
|
||||
let overlay = new St.Button({ label: 'No', style: 'text-decoration: underline; color: #4444ff;' });
|
||||
fadeBox.add(overlay);
|
||||
|
||||
function togglePadding(button) {
|
||||
switch(button.label) {
|
||||
case 'No':
|
||||
@@ -388,6 +392,20 @@ function test() {
|
||||
vfade.connect('clicked', function() { toggleFade(vfade); });
|
||||
toggleFade(vfade);
|
||||
|
||||
function toggleOverlay(button) {
|
||||
switch(button.label) {
|
||||
case 'No':
|
||||
button.label = 'Yes';
|
||||
break;
|
||||
case 'Yes':
|
||||
button.label = 'No';
|
||||
break;
|
||||
}
|
||||
scrollView.overlay_scrollbars = (button.label == 'Yes');
|
||||
}
|
||||
|
||||
overlay.connect('clicked', function() { toggleOverlay(overlay); });
|
||||
|
||||
UI.main(stage);
|
||||
}
|
||||
test();
|
||||
|
Reference in New Issue
Block a user