Re: Changing the background color in math menus

2021-03-04 Thread Jürgen Spitzmüller
Am Donnerstag, dem 04.03.2021 um 11:52 +0100 schrieb Stephan Witt:
> Yes it works. Thank you.

Great.

> While thinking about the change: wouldn’t it be better to move
> clear()
> into fill()?
> 
> Like the attached. In practice it’s the same probably. In theory it
> looks more safe.

I don't think we ever need to clear() there, as this only starts either
from scratch or from refill(). Otherwise we would have noticed. So I'd
go with my version.

Thanks
Jürgen




signature.asc
Description: This is a digitally signed message part
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Simplify checking whether files are controlled by SVN and GIT.

2021-03-04 Thread Richard Kimberly Heck
On 3/3/21 10:48 AM, Pavel Sanda wrote:
> On Fri, Dec 25, 2020 at 06:35:08PM +0100, Pavel Sanda wrote:
>> are you positive that cvs log does not actually try to connect to server 
>> (would
>> make us fail if you are offline)? It's really long time ago I used cvs, but
>> IIRC each tracked directory has the needed metadata locally at the place
>> so do we actualy need these changes to fulfil the users-list request?
>>
>> Sorry for nitpicking, but given that this piece of code is executed at each
>> document load we better be super careful here...
> Riki, I would like to have your feedback about the cvs part once you have
> some moment...

I'll have a look into it shortly.

Riki


-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Changing the background color in math menus

2021-03-04 Thread Stephan Witt
Am 04.03.2021 um 09:10 schrieb Jürgen Spitzmüller :
> 
> Am Donnerstag, dem 04.03.2021 um 08:24 +0100 schrieb Jürgen
> Spitzmüller:
>> Ah, that's this issue. We discussed this already. I remember you
>> mentioned some signal that is emitted on the Mac when the switch
>> happens and that you intended to investigate how dark mode in LyX can
>> be connected to this signal.
> 
> Stephan, can you try (and, if needed, play a bit) with the attached
> attempt?
> 
> This draws on your observations here:
> https://marc.info/?l=lyx-devel=160786312519532=2
> 
> Jürgen

Yes it works. Thank you.

While thinking about the change: wouldn’t it be better to move clear() into 
fill()?

Like the attached. In practice it’s the same probably. In theory it looks more 
safe.

If you don’t like it… no problem. I’m ok with your version too.

Stephan



darkmode-refill-2.diff
Description: Binary data
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Losing session settings on Mac (was: Using Lyx with git (instead of RCS))

2021-03-04 Thread Pavel Sanda
On Thu, Mar 04, 2021 at 07:57:41AM +0100, Stephan Witt wrote:
> Am 03.03.2021 um 22:25 schrieb Pavel Sanda :
> > 
> > On Wed, Mar 03, 2021 at 10:00:46PM +0100, Robert Neumann wrote:
> >>> Am 03.03.2021 um 17:44 schrieb Pavel Sanda :
> >>> On Wed, Mar 03, 2021 at 05:27:39PM +0100, Robert Neumann wrote:
> >> (-is there a way to have the version-control-menue showed permanently, 
> >> I have to activate it manually everytime
> > I do not understand this question. You mean toolbar?
>  yes of course, sorry for the incorrect description???
> >>> 
> >>> I do not experience your problem. The toolbars might get reset once upon 
> >>> a time
> >>> (for example if you are upgrading to a newer version of lyx) but generally
> >>> stay set consistently across sessions (linux here). 
> >>> 
> >>> If you
> >>> 1) close all your lyx sessions
> >>> 2) open new one and set toolbars acccording to your needs
> >>> 3) close session 
> >>> 4) open new session again the toolbar is lost?
> >> 
> >> not, not really: It works on 10.13 and 10.15 if I open Lyx directly, 
> >> If I double-click on a file in the finder it is gone...
> >> both LyX 2.3.6.3
> > 
> > I see, then this is bug specific to mac only.
> > There must be something different when lyx is launched via its icon and
> > when clicking just on the file.
> > 
> > CC-ing lyx-devel, Stephan might have a clue what's going on.
> 
> I cannot reproduce on Mac either. 

Actually I can. When I look into ~/Library/Preferences I see possible culprit --
there are two plist files: org.lyx.LyX-2.3.plist and second org.lyx.lyx.plist.

It seems that one of them is used when lyx is launched from icon and the second
when you click on some .lyx file.

Robert, if you click on some .lyx file and set VC Toolbar , then quit and again
click on .lyx file then the setting persists. Correct?

Pavel
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Changing the background color in math menus

2021-03-04 Thread Jürgen Spitzmüller
Am Donnerstag, dem 04.03.2021 um 07:40 +0100 schrieb Stephan Witt:
> I think it’s caused by the different dark mode switch. 
> On Mac I can switch to dark mode after LyX start…
> 
> 
> … or use it as my normal user desktop setting and then it’s probably
> fine.
> 
> 
> The switch at runtime should enforce an icon refresh. Is it easy to
> trigger?

Ah, that's this issue. We discussed this already. I remember you
mentioned some signal that is emitted on the Mac when the switch
happens and that you intended to investigate how dark mode in LyX can
be connected to this signal.

Jürgen 



signature.asc
Description: This is a digitally signed message part
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Changing the background color in math menus

2021-03-04 Thread Jürgen Spitzmüller
Am Donnerstag, dem 04.03.2021 um 08:24 +0100 schrieb Jürgen
Spitzmüller:
> Ah, that's this issue. We discussed this already. I remember you
> mentioned some signal that is emitted on the Mac when the switch
> happens and that you intended to investigate how dark mode in LyX can
> be connected to this signal.

Stephan, can you try (and, if needed, play a bit) with the attached
attempt?

This draws on your observations here:
https://marc.info/?l=lyx-devel=160786312519532=2

Jürgen

diff --git a/src/frontends/qt/GuiToolbar.cpp b/src/frontends/qt/GuiToolbar.cpp
index 5600f4a74f..8057d84a70 100644
--- a/src/frontends/qt/GuiToolbar.cpp
+++ b/src/frontends/qt/GuiToolbar.cpp
@@ -116,6 +116,14 @@ void GuiToolbar::fill()
 }
 
 
+void GuiToolbar::refill()
+{
+	filled_ = false;
+	clear();
+	fill();
+}
+
+
 void GuiToolbar::showEvent(QShowEvent * ev)
 {
 	fill();
diff --git a/src/frontends/qt/GuiToolbar.h b/src/frontends/qt/GuiToolbar.h
index 262b09ef07..d658f3f51b 100644
--- a/src/frontends/qt/GuiToolbar.h
+++ b/src/frontends/qt/GuiToolbar.h
@@ -152,6 +152,9 @@ public:
 	///
 	void toggle();
 
+	///
+	void refill();
+
 	/// toggles movability
 	void movable(bool silent = false);
 
diff --git a/src/frontends/qt/GuiView.cpp b/src/frontends/qt/GuiView.cpp
index a48540d28c..389e46eb21 100644
--- a/src/frontends/qt/GuiView.cpp
+++ b/src/frontends/qt/GuiView.cpp
@@ -1470,6 +1470,11 @@ bool GuiView::event(QEvent * e)
 		return QMainWindow::event(e);
 	}
 
+	case QEvent::ApplicationPaletteChange: {
+		refillToolbars();
+		return QMainWindow::event(e);
+	}
+
 	default:
 		return QMainWindow::event(e);
 	}
@@ -1739,6 +1744,13 @@ void GuiView::updateToolbars()
 }
 
 
+void GuiView::refillToolbars()
+{
+	for (auto const & tb_p : d.toolbars_)
+		tb_p.second->refill();
+}
+
+
 void GuiView::setBuffer(Buffer * newBuffer, bool switch_to)
 {
 	LYXERR(Debug::DEBUG, "Setting buffer: " << newBuffer << endl);
diff --git a/src/frontends/qt/GuiView.h b/src/frontends/qt/GuiView.h
index 4c610e0ef9..f5024e5ef4 100644
--- a/src/frontends/qt/GuiView.h
+++ b/src/frontends/qt/GuiView.h
@@ -149,6 +149,8 @@ public:
 	/// updates the possible layouts selectable
 	void updateLayoutList();
 	void updateToolbars();
+	/// refill the toolbars (dark mode switch)
+	void refillToolbars();
 
 	///
 	LayoutBox * getLayoutDialog() const;


signature.asc
Description: This is a digitally signed message part
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel