Skip to content

Commit

Permalink
Improved adaptation to beamer resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
vdhoeven committed Apr 26, 2019
1 parent d1eb5e4 commit cb1b6d5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion TeXmacs/progs/texmacs/texmacs/tm-view.scm
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
(set! saved-informative-flags (get-init-env "info-flag"))
(init-env "info-flag" "none")
(full-screen-mode #t #f)
(fit-to-screen-width))))
(fit-to-screen))))

(tm-define (toggle-full-screen-edit-mode)
(:synopsis "Toggle full screen edit mode.")
Expand Down
6 changes: 2 additions & 4 deletions src/Edit/Interface/edit_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -740,8 +740,7 @@ edit_interface_rep::apply_changes () {
if (cur_sb && ey2 - ey1 > h) w -= scrollbar_width ();
if (cur_sb && ex2 - ex1 > w) h -= scrollbar_width ();
if (ex2 - ex1 <= w + 2*PIXEL) {
if (medium == "automatic" ||
(medium == "beamer" && full_screen))
if (medium == "automatic")
ex2= ex1 + w;
else {
#ifdef X11TEXMACS
Expand All @@ -752,8 +751,7 @@ edit_interface_rep::apply_changes () {
}
}
if (ey2 - ey1 <= h + 2*PIXEL) {
if (medium == "papyrus" || medium == "automatic" ||
(medium == "beamer" && full_screen))
if (medium == "papyrus" || medium == "automatic")
ey1= ey2 - h;
else {
#ifdef X11TEXMACS
Expand Down
12 changes: 9 additions & 3 deletions src/Plugins/Qt/qt_tm_widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -900,6 +900,9 @@ qt_tm_widget_rep::set_full_screen(bool flag) {
QWidget *win = mainwindow()->window();
if (win) {
if (flag ) {
QPalette pal;
pal.setColor(QPalette::Mid, Qt::black);
mainwindow()->setPalette(pal);
#ifdef UNIFIED_TOOLBAR
if (use_unified_toolbar) {
//HACK: we disable unified toolbar since otherwise
Expand All @@ -911,13 +914,16 @@ qt_tm_widget_rep::set_full_screen(bool flag) {
#endif
// mainwindow()->window()->setContentsMargins(0,0,0,0);
//win->showFullScreen();
win->setWindowState(win->windowState() ^ Qt::WindowFullScreen);
} else {
win->setWindowState(win->windowState() | Qt::WindowFullScreen);
}
else {
QPalette pal;
mainwindow()->setPalette(pal);
bool cache = visibility[0];
visibility[0] = false;
update_visibility();
// win->showNormal();
win->setWindowState(win->windowState() ^ Qt::WindowFullScreen);
win->setWindowState(win->windowState() & ~Qt::WindowFullScreen);

visibility[0] = cache;
update_visibility();
Expand Down

0 comments on commit cb1b6d5

Please sign in to comment.