Forum > Linux
Hiding the window caption
MarkMLl:
This code suffices to toggle the display of the application caption
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} --- 'z': begin case BorderStyle of bsSizeable: BorderStyle := bsNone otherwise BorderStyle := bsSizeable end; testCard(true) end;
but only works reliably for Qt/Qt5 (i.e. not GTK2/GTK3).
Does anybody have anything better?
MarkMLl
Blaazen:
It seems I found GTk2 hack: set Constraints.MinHeight and Constraints.MinWidth to something (in OI or in code).
GTk2 probably sets Width and Height to zero somewhere during the switching the BorderStyle.
MarkMLl:
Is that using the contsraint of the form, or getting at the caption in some way?
Trying that using code below (Laz 2.2.4, FPC 3.2.2) using GTK2 on KDE hides/unhides the entire window.
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} --- 'z': begin with Constraints do begin MinWidth := 0; MinHeight := 0 end; case BorderStyle of bsSizeable: BorderStyle := bsNone otherwise BorderStyle := bsSizeable end; testCard(true) end;
Added detail: what I'm doing isn't entirely cosmetic, since it makes sure that space on the physical display being calibrated isn't occupied by the caption. I can work around the problem by using Qt5 as the widget set, although that does mean that I can't run it on the old laptop I was hoping to use... I've got a slightly rickety optical bench setup and there's a big advantage to being able to keep the video generation well separated from the computer I'm sitting at.
MarkMLl
zeljko:
From Qt world: When changing windowFlags (that's border etc) you should hide(), set new windowflags, show(). Try that with gtk2, x11 philosophy should be same.
MarkMLl:
With GTK2, the entire form/window appears to be being hidden (I didn't remember that behaviour, but I've upgraded the distro since writing this and there was a point-level libgtk upgrade).
It's the same irrespective of the presence or hide/show (I've stuck the form name in there to be absolutely unambiguous), of the constraint change, or of the APM I added for good measure.
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} --- 'z': beginForm1.Hide;{ with Constraints do begin MinWidth := 0; MinHeight := 0 end; } case BorderStyle of bsSizeable: BorderStyle := bsNone otherwise BorderStyle := bsSizeable end;Form1.Show;Application.ProcessMessages; testCard(true) end;
Everything else works fine: testcard() basically paints a bullseye with rings at adjustable positions.
I wonder whether there's any overlap here with people who've used circular output which presumably didn't have a caption?
In any event, Qt5 works and I suspect I might have to live with that.
MarkMLl
Navigation
[0] Message Index
[#] Next page