Re: Windows Dark Mode and "fusion" style

2023-07-08 Thread Yu Jin
Am Fr., 7. Juli 2023 um 19:31 Uhr schrieb Yu Jin:

>
> Yeah we need other opinions on this.
>

I have created a new ticket
https://www.lyx.org/trac/ticket/12832
I think that is better to keep track of.
-- 
  Eugene
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Windows Dark Mode and "fusion" style

2023-07-07 Thread Yu Jin
Am Fr., 7. Juli 2023 um 15:25 Uhr schrieb Thibaut Cuvelier:

> Qt hasn't changed its -style parameter at least since Qt 4 (2005), that's
> quite stable (there is also an environment variable, QT_STYLE_OVERRIDE).
> I couldn't find any way to tell if the style was set from the command line
> or not (or to get the default style for the current platform), so we would
> always need to check manually whether there has been some CLI-set style,
> whatever path we end up taking.
>

>From what I understand Qt has some style picking priority when creating the
QApplication.
https://stackoverflow.com/questions/48093102/how-does-qt-select-a-default-style


(There is some precedent with locale handling, where Qt is trying hard to
> impose its locale, it seems.)
> (More details: the -style parameter is dealt with in
> QGuiApplicationPrivate, not accessible from LyX and not available anywhere
> in the API, as far as I can tell.)
>
> As Qt can dynamically change the style at runtime, why would you need to
> know it when instantiating GuiApplication? Anyway, in my patch, the style
> is set before calling QApplication::exec, before any user interaction can
> take place, the user should not see any difference in delay before
> interacting with LyX.
>

Your patch basically disables the "-style" CLI argument, because it sets
(overwrites) the style *after* QApplication is created. My patch sets the
style *before* QApplication is created, this style is then used by Qt when
creating QApplication. If the user passed -style argument however,
QApplication is created using that argument instead, because of some
priority rules (I think it should be similar with the environment
variable). But if you set the style after creation, those rules don't
apply, it just sets the style on the existing QApplication.

So
1. your patch would need to implement that priority rule(s) by its own
instead of letting Qt handle it and
2. frontend::Application * createApplication(int & argc, char * argv[])
removes all the arguments it knows so the -style argument is not present
anymore when your patch sets the style, so additionally you would need to
read that argument before createApplication (here we go again), save it and
then do task 1 afterwards.

>
> I have no opinion on whether the LyXRC file should be read before or after
> createApplication, I have no idea about the trade-offs here. What do others
> think about it? This change may impact other platforms too.
>

Yeah we need other opinions on this.

>
> Anyway, it works as expected.
>
>
>> Also note that in the patch I have set "fusion" to default on Windows,
>> other OSes can do it the same way if they want.
>>
>
> Fusion doesn't look native at all on any platform by design
> ,
> but it's the only not-too-terrible choice for dark themes on Windows :/. I
> would do either of the following: let Qt handle the default theme or only
> impose the strange Fusion style on users when we know it's the least worst
> for users. The idea is to have a good default for users, with LyX being as
> native-looking as possible --- a goal that is currently achieved, albeit
> the support for dark themes on Windows is really subpar (like many Windows
> apps).
>

To be honest I think that the fusion style looks much more native on
Windows 11 than the windowsvista style.

>
> Actually, I'd be OK with merging this patch with a change in the way the
> default theme is selected.
>
-- 
  Eugene
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Windows Dark Mode and "fusion" style

2023-07-07 Thread Thibaut Cuvelier
On Fri, 7 Jul 2023 at 10:13, Yu Jin  wrote:

> Am Fr., 7. Juli 2023 um 04:37 Uhr schrieb Thibaut Cuvelier:
>
>> I'm having an issue with your patch: QStyle::name has only been added in
>> Qt 6.1 (https://doc.qt.io/qt-6/qstyle.html#name). I believe
>> QObject::objectName should do the trick too.
>>
>> As I understand your problem, in LyX.cpp, LyX::exec first creates a
>> GuiApplication (line 358) before initialising LyX (line 366). If I do the
>> initialisation in GuiApplication::exec instead, I don't get any crash;
>> actually, your patch works :)!
>> I have added a similar line in PrefInput::applyRC so that the style
>> change applies immediately when clicking Apply in the Preferences window.
>>
>
> I think it is actually better to do that in PrefUserInterface::applyRC for
> affiliation.
>

To be honest, I took a place that might match and where the code worked. I
tried to understand the differences between these functions, but I couldn't
get it. A bit of documentation would have helped


> I'm attaching the corresponding patch.
>>
>
> I didn't understand this part:
> @@ -718,13 +718,13 @@ GuiView::GuiView(int id)
>   connect(zoom_value_, SIGNAL(pressed()), this,
> SLOT(showZoomContextMenu()));
>   // zoom_value_->setPalette(palette);
>   zoom_value_->setForegroundRole(statusBar()->foregroundRole());
>   zoom_value_->setFixedHeight(fm.height());
>  #if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0))
> - zoom_value_->setMinimumWidth(fm.horizontalAdvance("444\%"));
> + zoom_value_->setMinimumWidth(fm.horizontalAdvance("444%"));
>  #else
> - zoom_value_->setMinimumWidth(fm.width("444\%"));
> + zoom_value_->setMinimumWidth(fm.width("444%"));
>  #endif
>   zoom_value_->setAlignment(Qt::AlignCenter);
>   zoom_value_->setText(toqstr(bformat(_("[[ZOOM]]%1$d%"), zoom)));
>   statusBar()->addPermanentWidget(zoom_value_);
>   zoom_value_->setEnabled(currentBufferView());
>

It's just fixing a few compiler warnings, it doesn't have to be in the same
patch.


> Side question: why is createApplication declared in Application.h but
>> defined in GuiApplication.cpp?
>>
>>
>> On Fri, 7 Jul 2023 at 02:23, Thibaut Cuvelier wrote:
>>
>>> Can't you use setStyle later on, once LyXRC is read?
>>>
>>
> You could, like in your patch, but this creates another problem (see below)
>
>
>> I suspect it should be enough to apply the style to the whole
>>> application, based on the source code (
>>> https://github.com/qt/qtbase/blob/dev/src/widgets/kernel/qapplication.cpp#L971),
>>> as I understand that GuiApplication is the root widget for the whole LyX.
>>>
>>> Also, I believe that LyXRC shouldn't take precedence over CLI arguments
>>> (-style windows, for instance); does Qt implement this itself or do we have
>>> to check in QCoreApplication::arguments if a style is given?
>>>
>>
> I believe the way would be to set the style *before* the QApplication is
> created, then if any style is given in CLI arguments, QApplication uses
> that over the one previously set.
>
> I don't know, to me it seems we *need* to know style setting from lyxrc
> before we create the gui app
> frontend::GuiApplication * guiApp = new frontend::GuiApplication(argc,
> argv);
> which is not given.
> otherwise we would need to check cli arguments manually for "-style" and I
> don't want to do that, if Qt decides to change those in the future we would
> have to put more work into it.
> What can be done is calling readRcFile("preferences", true) before
> CreateApplication, like I have done here in the attached patch, but I don't
> know if that is ok or not, it seems to work, but I can't assess it 100%,
> any ideas/objections?
>

Qt hasn't changed its -style parameter at least since Qt 4 (2005), that's
quite stable (there is also an environment variable, QT_STYLE_OVERRIDE). I
couldn't find any way to tell if the style was set from the command line or
not (or to get the default style for the current platform), so we would
always need to check manually whether there has been some CLI-set style,
whatever path we end up taking. (There is some precedent with locale
handling, where Qt is trying hard to impose its locale, it seems.)
(More details: the -style parameter is dealt with in
QGuiApplicationPrivate, not accessible from LyX and not available anywhere
in the API, as far as I can tell.)

As Qt can dynamically change the style at runtime, why would you need to
know it when instantiating GuiApplication? Anyway, in my patch, the style
is set before calling QApplication::exec, before any user interaction can
take place, the user should not see any difference in delay before
interacting with LyX.

I have no opinion on whether the LyXRC file should be read before or after
createApplication, I have no idea about the trade-offs here. What do others
think about it? This change may impact other platforms too.
Anyway, it works as expected.


> Also note that in the patch I have set "fusion" to default on Windows,
> other OSes can do it the same way if they want.
>

Fusion doesn't 

Re: Windows Dark Mode and "fusion" style

2023-07-07 Thread Yu Jin
Am Fr., 7. Juli 2023 um 04:37 Uhr schrieb Thibaut Cuvelier:

> I'm having an issue with your patch: QStyle::name has only been added in
> Qt 6.1 (https://doc.qt.io/qt-6/qstyle.html#name). I believe
> QObject::objectName should do the trick too.
>
> As I understand your problem, in LyX.cpp, LyX::exec first creates a
> GuiApplication (line 358) before initialising LyX (line 366). If I do the
> initialisation in GuiApplication::exec instead, I don't get any crash;
> actually, your patch works :)!
> I have added a similar line in PrefInput::applyRC so that the style change
> applies immediately when clicking Apply in the Preferences window.
>

I think it is actually better to do that in PrefUserInterface::applyRC for
affiliation.

>
> I'm attaching the corresponding patch.
>

I didn't understand this part:
@@ -718,13 +718,13 @@ GuiView::GuiView(int id)
  connect(zoom_value_, SIGNAL(pressed()), this,
SLOT(showZoomContextMenu()));
  // zoom_value_->setPalette(palette);
  zoom_value_->setForegroundRole(statusBar()->foregroundRole());
  zoom_value_->setFixedHeight(fm.height());
 #if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0))
- zoom_value_->setMinimumWidth(fm.horizontalAdvance("444\%"));
+ zoom_value_->setMinimumWidth(fm.horizontalAdvance("444%"));
 #else
- zoom_value_->setMinimumWidth(fm.width("444\%"));
+ zoom_value_->setMinimumWidth(fm.width("444%"));
 #endif
  zoom_value_->setAlignment(Qt::AlignCenter);
  zoom_value_->setText(toqstr(bformat(_("[[ZOOM]]%1$d%"), zoom)));
  statusBar()->addPermanentWidget(zoom_value_);
  zoom_value_->setEnabled(currentBufferView());


>
> Side question: why is createApplication declared in Application.h but
> defined in GuiApplication.cpp?
>
>
> On Fri, 7 Jul 2023 at 02:23, Thibaut Cuvelier wrote:
>
>> Can't you use setStyle later on, once LyXRC is read?
>>
>
You could, like in your patch, but this creates another problem (see below)


> I suspect it should be enough to apply the style to the whole application,
>> based on the source code (
>> https://github.com/qt/qtbase/blob/dev/src/widgets/kernel/qapplication.cpp#L971),
>> as I understand that GuiApplication is the root widget for the whole LyX.
>>
>> Also, I believe that LyXRC shouldn't take precedence over CLI arguments
>> (-style windows, for instance); does Qt implement this itself or do we have
>> to check in QCoreApplication::arguments if a style is given?
>>
>
I believe the way would be to set the style *before* the QApplication is
created, then if any style is given in CLI arguments, QApplication uses
that over the one previously set.

I don't know, to me it seems we *need* to know style setting from lyxrc
before we create the gui app
frontend::GuiApplication * guiApp = new frontend::GuiApplication(argc,
argv);
which is not given.
otherwise we would need to check cli arguments manually for "-style" and I
don't want to do that, if Qt decides to change those in the future we would
have to put more work into it.
What can be done is calling readRcFile("preferences", true) before
CreateApplication, like I have done here in the attached patch, but I don't
know if that is ok or not, it seems to work, but I can't assess it 100%,
any ideas/objections?
Also note that in the patch I have set "fusion" to default on Windows,
other OSes can do it the same way if they want.
-- 
  Eugene


0001-Implement-style-selection-dialog.patch
Description: Binary data
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Windows Dark Mode and "fusion" style

2023-07-06 Thread Thibaut Cuvelier
I'm having an issue with your patch: QStyle::name has only been added in Qt
6.1 (https://doc.qt.io/qt-6/qstyle.html#name). I believe
QObject::objectName should do the trick too.

As I understand your problem, in LyX.cpp, LyX::exec first creates a
GuiApplication (line 358) before initialising LyX (line 366). If I do the
initialisation in GuiApplication::exec instead, I don't get any crash;
actually, your patch works :)!
I have added a similar line in PrefInput::applyRC so that the style change
applies immediately when clicking Apply in the Preferences window.
I'm attaching the corresponding patch.

Side question: why is createApplication declared in Application.h but
defined in GuiApplication.cpp?

Thibaut Cuvelier


On Fri, 7 Jul 2023 at 02:23, Thibaut Cuvelier  wrote:

> On Thu, 6 Jul 2023 at 10:34, Yu Jin  wrote:
>
>> Am Do., 6. Juli 2023 um 03:47 Uhr schrieb Thibaut Cuvelier:
>>
>>> On Wed, 5 Jul 2023 at 22:02, Enrico Forestieri wrote:
>>>
 On Wed, Jul 05, 2023 at 08:42:21PM +0200, Pavel Sanda wrote:
 >
 >I think your patch should go for windows port only as it would
 probably
 >interfere with ppl choosing windows style under linux (yes, apparently
 >there are users choosing this as I read users list).

 I don't think this is a good idea because LyX would look different from
 any other application.

>>>
>>> +1, the Fusion style isn't native at all (the colours are completely
>>> off, for instance). Maybe some users will like it, though (like the author
>>> of https://www.qt.io/blog/dark-mode-on-windows-11-with-qt-6.5).
>>>
>>> However, it seems that the classic Windows theme has a dark mode
>>> starting with Qt 6.5 (out since April):
>>> https://www.qt.io/blog/dark-mode-on-windows-11-with-qt-6.5. The Windows
>>> style, both in Qt 5 and Qt 6, is horrible, though... Here is what it looks
>>> like (2.4 beta 3 with Qt 6.5.1 as built by Eugene; run with:
>>> .\LyX.exe -platform windows:darkmode=2 -style windows
>>> ):
>>>
>>> What's strange is that the situation isn't much better for Qt Quick,
>>> with no native Windows dark theme. There are other open-source projects
>>> that provide a good Windows theme that also works in dark, such as
>>> https://github.com/witalihirsch/QTWin11 for Python only or
>>> https://github.com/marunemitsu/QTFluent (very modern style, unlike the
>>> default Vista one). I have seen good results with
>>> https://github.com/ColinDuquesnoy/QDarkStyleSheet (but not with its
>>> light theme!), which is more or less maintained and should work with Qt 6
>>> (not PyQt 6 out of the box, though). Wireshark went that route, but the
>>> code didn't get merged (
>>> https://gitlab.com/wireshark/wireshark/-/merge_requests/6382).
>>>
>>> Overall, it seems that Qt's dark theme for Windows is inexistent; their
>>> preferred solution is to avoid implementing a proper theme, so that people
>>> have to rely on unmaintained projects or use their own solution. They rely
>>> consider it done (
>>> https://bugreports.qt.io/browse/QTBUG-72028#comment-712180)!
>>>
>>> How complex would it be to have a new LyX setting to choose the Qt
>>> theme? I believe it should not be too hard, as you can change the style on
>>> QApplication. Or is there something I'm missing?
>>>
>>
>> I tried my luck here (patch attached) but it is not working though. While
>> I think I got the UI and LyXRC right, the problem is that at the time of
>> creation of QApplication the LyXRC is initialized but not read, so the
>> saved style preference is not available.
>>
>> This stacktrace is from application creation:
>>   LyX.exe!lyx::createApplication(int & argc, char * * argv) Zeile 224 C++
>>   LyX.exe!lyx::LyX::exec(int & argc, char * * argv) Zeile 358 C++
>>   LyX.exe!main(int argc, char * * argv) Zeile 55 C++
>>
>> This one from LyXRC reading:
>>   LyX.exe!lyx::LyXRC::read(lyx::Lexer & lexrc, bool check_format) Zeile
>> 608 C++
>>   LyX.exe!lyx::LyXRC::read(const lyx::support::FileName & filename, bool
>> check_format) Zeile 242 C++
>>   LyX.exe!lyx::LyX::readRcFile(const std::string & name, bool
>> check_format) Zeile 1148 C++
>>   LyX.exe!lyx::LyX::init() Zeile 998 C++
>>   LyX.exe!lyx::LyX::init(int & argc, char * * argv) Zeile 483 C++
>>   LyX.exe!lyx::LyX::exec(int & argc, char * * argv) Zeile 366 C++
>>   LyX.exe!main(int argc, char * * argv) Zeile 55 C++
>>
>> second function from bottom: line 358 vs 366.
>>
>> Any ideas what I could do here?
>>
>
> Can't you use setStyle later on, once LyXRC is read? I suspect it should
> be enough to apply the style to the whole application, based on the source
> code (
> https://github.com/qt/qtbase/blob/dev/src/widgets/kernel/qapplication.cpp#L971),
> as I understand that GuiApplication is the root widget for the whole LyX.
>
> Also, I believe that LyXRC shouldn't take precedence over CLI arguments
> (-style windows, for instance); does Qt implement this itself or do we have
> to check in QCoreApplication::arguments if a style is given?
>



Re: Windows Dark Mode and "fusion" style

2023-07-06 Thread Thibaut Cuvelier
On Thu, 6 Jul 2023 at 10:34, Yu Jin  wrote:

> Am Do., 6. Juli 2023 um 03:47 Uhr schrieb Thibaut Cuvelier:
>
>> On Wed, 5 Jul 2023 at 22:02, Enrico Forestieri wrote:
>>
>>> On Wed, Jul 05, 2023 at 08:42:21PM +0200, Pavel Sanda wrote:
>>> >
>>> >I think your patch should go for windows port only as it would probably
>>> >interfere with ppl choosing windows style under linux (yes, apparently
>>> >there are users choosing this as I read users list).
>>>
>>> I don't think this is a good idea because LyX would look different from
>>> any other application.
>>>
>>
>> +1, the Fusion style isn't native at all (the colours are completely off,
>> for instance). Maybe some users will like it, though (like the author of
>> https://www.qt.io/blog/dark-mode-on-windows-11-with-qt-6.5).
>>
>> However, it seems that the classic Windows theme has a dark mode starting
>> with Qt 6.5 (out since April):
>> https://www.qt.io/blog/dark-mode-on-windows-11-with-qt-6.5. The Windows
>> style, both in Qt 5 and Qt 6, is horrible, though... Here is what it looks
>> like (2.4 beta 3 with Qt 6.5.1 as built by Eugene; run with:
>> .\LyX.exe -platform windows:darkmode=2 -style windows
>> ):
>>
>> What's strange is that the situation isn't much better for Qt Quick, with
>> no native Windows dark theme. There are other open-source projects that
>> provide a good Windows theme that also works in dark, such as
>> https://github.com/witalihirsch/QTWin11 for Python only or
>> https://github.com/marunemitsu/QTFluent (very modern style, unlike the
>> default Vista one). I have seen good results with
>> https://github.com/ColinDuquesnoy/QDarkStyleSheet (but not with its
>> light theme!), which is more or less maintained and should work with Qt 6
>> (not PyQt 6 out of the box, though). Wireshark went that route, but the
>> code didn't get merged (
>> https://gitlab.com/wireshark/wireshark/-/merge_requests/6382).
>>
>> Overall, it seems that Qt's dark theme for Windows is inexistent; their
>> preferred solution is to avoid implementing a proper theme, so that people
>> have to rely on unmaintained projects or use their own solution. They rely
>> consider it done (
>> https://bugreports.qt.io/browse/QTBUG-72028#comment-712180)!
>>
>> How complex would it be to have a new LyX setting to choose the Qt theme?
>> I believe it should not be too hard, as you can change the style on
>> QApplication. Or is there something I'm missing?
>>
>
> I tried my luck here (patch attached) but it is not working though. While
> I think I got the UI and LyXRC right, the problem is that at the time of
> creation of QApplication the LyXRC is initialized but not read, so the
> saved style preference is not available.
>
> This stacktrace is from application creation:
>   LyX.exe!lyx::createApplication(int & argc, char * * argv) Zeile 224 C++
>   LyX.exe!lyx::LyX::exec(int & argc, char * * argv) Zeile 358 C++
>   LyX.exe!main(int argc, char * * argv) Zeile 55 C++
>
> This one from LyXRC reading:
>   LyX.exe!lyx::LyXRC::read(lyx::Lexer & lexrc, bool check_format) Zeile
> 608 C++
>   LyX.exe!lyx::LyXRC::read(const lyx::support::FileName & filename, bool
> check_format) Zeile 242 C++
>   LyX.exe!lyx::LyX::readRcFile(const std::string & name, bool
> check_format) Zeile 1148 C++
>   LyX.exe!lyx::LyX::init() Zeile 998 C++
>   LyX.exe!lyx::LyX::init(int & argc, char * * argv) Zeile 483 C++
>   LyX.exe!lyx::LyX::exec(int & argc, char * * argv) Zeile 366 C++
>   LyX.exe!main(int argc, char * * argv) Zeile 55 C++
>
> second function from bottom: line 358 vs 366.
>
> Any ideas what I could do here?
>

Can't you use setStyle later on, once LyXRC is read? I suspect it should be
enough to apply the style to the whole application, based on the source
code (
https://github.com/qt/qtbase/blob/dev/src/widgets/kernel/qapplication.cpp#L971),
as I understand that GuiApplication is the root widget for the whole LyX.

Also, I believe that LyXRC shouldn't take precedence over CLI arguments
(-style windows, for instance); does Qt implement this itself or do we have
to check in QCoreApplication::arguments if a style is given?
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Windows Dark Mode and "fusion" style

2023-07-06 Thread Yu Jin
Am Do., 6. Juli 2023 um 03:47 Uhr schrieb Thibaut Cuvelier:

> On Wed, 5 Jul 2023 at 22:02, Enrico Forestieri wrote:
>
>> On Wed, Jul 05, 2023 at 08:42:21PM +0200, Pavel Sanda wrote:
>> >
>> >I think your patch should go for windows port only as it would probably
>> >interfere with ppl choosing windows style under linux (yes, apparently
>> >there are users choosing this as I read users list).
>>
>> I don't think this is a good idea because LyX would look different from
>> any other application.
>>
>
> +1, the Fusion style isn't native at all (the colours are completely off,
> for instance). Maybe some users will like it, though (like the author of
> https://www.qt.io/blog/dark-mode-on-windows-11-with-qt-6.5).
>
> However, it seems that the classic Windows theme has a dark mode starting
> with Qt 6.5 (out since April):
> https://www.qt.io/blog/dark-mode-on-windows-11-with-qt-6.5. The Windows
> style, both in Qt 5 and Qt 6, is horrible, though... Here is what it looks
> like (2.4 beta 3 with Qt 6.5.1 as built by Eugene; run with:
> .\LyX.exe -platform windows:darkmode=2 -style windows
> ):
>
> What's strange is that the situation isn't much better for Qt Quick, with
> no native Windows dark theme. There are other open-source projects that
> provide a good Windows theme that also works in dark, such as
> https://github.com/witalihirsch/QTWin11 for Python only or
> https://github.com/marunemitsu/QTFluent (very modern style, unlike the
> default Vista one). I have seen good results with
> https://github.com/ColinDuquesnoy/QDarkStyleSheet (but not with its light
> theme!), which is more or less maintained and should work with Qt 6 (not
> PyQt 6 out of the box, though). Wireshark went that route, but the code
> didn't get merged (
> https://gitlab.com/wireshark/wireshark/-/merge_requests/6382).
>
> Overall, it seems that Qt's dark theme for Windows is inexistent; their
> preferred solution is to avoid implementing a proper theme, so that people
> have to rely on unmaintained projects or use their own solution. They rely
> consider it done (
> https://bugreports.qt.io/browse/QTBUG-72028#comment-712180)!
>
> How complex would it be to have a new LyX setting to choose the Qt theme?
> I believe it should not be too hard, as you can change the style on
> QApplication. Or is there something I'm missing?
>

I tried my luck here (patch attached) but it is not working though. While I
think I got the UI and LyXRC right, the problem is that at the time of
creation of QApplication the LyXRC is initialized but not read, so the
saved style preference is not available.

This stacktrace is from application creation:
  LyX.exe!lyx::createApplication(int & argc, char * * argv) Zeile 224 C++
  LyX.exe!lyx::LyX::exec(int & argc, char * * argv) Zeile 358 C++
  LyX.exe!main(int argc, char * * argv) Zeile 55 C++

This one from LyXRC reading:
  LyX.exe!lyx::LyXRC::read(lyx::Lexer & lexrc, bool check_format) Zeile 608
C++
  LyX.exe!lyx::LyXRC::read(const lyx::support::FileName & filename, bool
check_format) Zeile 242 C++
  LyX.exe!lyx::LyX::readRcFile(const std::string & name, bool check_format)
Zeile 1148 C++
  LyX.exe!lyx::LyX::init() Zeile 998 C++
  LyX.exe!lyx::LyX::init(int & argc, char * * argv) Zeile 483 C++
  LyX.exe!lyx::LyX::exec(int & argc, char * * argv) Zeile 366 C++
  LyX.exe!main(int argc, char * * argv) Zeile 55 C++

second function from bottom: line 358 vs 366.

Any ideas what I could do here?
-- 
  Eugene


0001-Implement-style-selection-dialog.patch
Description: Binary data
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Windows Dark Mode and "fusion" style

2023-07-05 Thread Enrico Forestieri

On Wed, Jul 05, 2023 at 08:42:21PM +0200, Pavel Sanda wrote:


I think your patch should go for windows port only as it would probably 
interfere with ppl choosing windows style under linux (yes, apparently 
there are users choosing this as I read users list).


I don't think this is a good idea because LyX would look different from 
any other application.


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


Re: Windows Dark Mode and "fusion" style

2023-07-05 Thread Pavel Sanda
On Wed, Jul 05, 2023 at 09:58:24AM +0200, Stephan Witt wrote:
> > Actually Qt blog says that "their" preferred style on Windows is fusion 
> > ??\_(???)_/??.
> > 
> > So would that be something we want to set on all platforms? or only Windows?

I see only fusion and windows style options on debian without installing 
optional packages
(with fusion being default).

> IMO the Windows platform only patch.

+1

I think your patch should go for windows port only as it would probably 
interfere
with ppl choosing windows style under linux (yes, apparently there are users 
choosing
this as I read users list).

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


Re: Windows Dark Mode and "fusion" style

2023-07-05 Thread Pavel Sanda
On Tue, Jul 04, 2023 at 10:46:45PM -0400, Richard Kimberly Heck wrote:
> On 7/4/23 09:41, Pavel Sanda wrote:
> >On Tue, Jul 04, 2023 at 10:55:14AM +0200, Yu Jin wrote:
> >>Am Di., 4. Juli 2023 um 10:40 Uhr schrieb Jürgen Spitzmüller:
> >>
> >>>Am Dienstag, dem 04.07.2023 um 10:33 +0200 schrieb Yu Jin:
> How do you switch on Linux/MacOS? Or does it just follow the system
> setting?
> >>>It follows the system settings unless you use a dark style via cl
> >>>switch.
> >On linux systems where desktop manager does not do it automatically, you
> >can use (in case of QT 5) qt5ct tool to set it up. E.g. you select fusion
> >style and "darker" (or any other you might like) color scheme.
> >
> >Then before running lyx you set the environment variable
> >QT_QPA_PLATFORMTHEME=qt5ct
> >and that should work (tested on oldstable debian).
> 
> Something like this might go into the release notes, and onto the wiki.

It's in the wiki already. P
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Windows Dark Mode and "fusion" style

2023-07-05 Thread Daniel

On 2023-07-05 09:43, Yu Jin wrote:

Am Di., 4. Juli 2023 um 15:42 Uhr schrieb Pavel Sanda:

On Tue, Jul 04, 2023 at 10:55:14AM +0200, Yu Jin wrote:
 > Am Di., 4. Juli 2023 um 10:40 Uhr schrieb Jürgen Spitzmüller:
 >
 > > Am Dienstag, dem 04.07.2023 um 10:33 +0200 schrieb Yu Jin:
 > > > How do you switch on Linux/MacOS? Or does it just follow the
system
 > > > setting?
 > >
 > > It follows the system settings unless you use a dark style via cl
 > > switch.

On linux systems where desktop manager does not do it automatically, you
can use (in case of QT 5) qt5ct tool to set it up. E.g. you select
fusion
style and "darker" (or any other you might like) color scheme.

Then before running lyx you set the environment variable
QT_QPA_PLATFORMTHEME=qt5ct
and that should work (tested on oldstable debian).

 > What if we make "fusion" style default on windows then? That
would make
 > LyX's behavior the same as on Linux and MacOS.

Given that you are now the principal maintainer of the windows port
I think that's up to you to decide.

Advantage of fusion is that it will look the same across platform
disadvantage might be that it looks less native to windows than
other apps on your desktop?


Actually Qt blog says that "their" preferred style on Windows is fusion 
¯\_(ツ)_/¯.


So would that be something we want to set on all platforms? or only Windows?
I attached 2 patches accordingly, the style can be overwritten by the 
user through command line arguments as before.


Which one should I push?
--
   Eugene



IMO, the way to go is to have a setting in Preferences, User Interface 
that lets the user choose the style (which is then applied after a 
restart of LyX). A simple combobox that let's one choose between the 
styles which can be queried from QStyleFactory::keys().


This would be good to have on both Windows and macOS. Maybe the default 
should still be the default native style on both systems since it 
provides the most native look and feel? But one could then optionally 
choose the fusion style (among others).


On Windows, this would apparently offer dark mode support. On macOS, one 
could get around a buggy native style if wanted (e.g. remember the time 
when labels on tabs disappeared and the still blue lines between tabs 
with Qt 5). I am ignorant about Linux.


Daniel

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


Re: Windows Dark Mode and "fusion" style

2023-07-05 Thread Stephan Witt
Am 05.07.2023 um 09:43 schrieb Yu Jin :
> 
> Am Di., 4. Juli 2023 um 15:42 Uhr schrieb Pavel Sanda:
> On Tue, Jul 04, 2023 at 10:55:14AM +0200, Yu Jin wrote:
> > Am Di., 4. Juli 2023 um 10:40 Uhr schrieb Jürgen Spitzmüller:
> > 
> > > Am Dienstag, dem 04.07.2023 um 10:33 +0200 schrieb Yu Jin:
> > > > How do you switch on Linux/MacOS? Or does it just follow the system
> > > > setting?
> > >
> > > It follows the system settings unless you use a dark style via cl
> > > switch.
> 
> On linux systems where desktop manager does not do it automatically, you
> can use (in case of QT 5) qt5ct tool to set it up. E.g. you select fusion
> style and "darker" (or any other you might like) color scheme.
> 
> Then before running lyx you set the environment variable
> QT_QPA_PLATFORMTHEME=qt5ct
> and that should work (tested on oldstable debian).
> 
> > What if we make "fusion" style default on windows then? That would make
> > LyX's behavior the same as on Linux and MacOS.
> 
> Given that you are now the principal maintainer of the windows port
> I think that's up to you to decide.
> 
> Advantage of fusion is that it will look the same across platform
> disadvantage might be that it looks less native to windows than
> other apps on your desktop?
> 
> Actually Qt blog says that "their" preferred style on Windows is fusion 
> ¯\_(ツ)_/¯.
> 
> So would that be something we want to set on all platforms? or only Windows?
> I attached 2 patches accordingly, the style can be overwritten by the user 
> through command line arguments as before.
> 
> Which one should I push?

IMO the Windows platform only patch.

On macOS the command line is not an option for the „ordinary“ user. 
The change in style of e.g scrollbars gives LyX a strange feeling.

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


Re: Windows Dark Mode and "fusion" style

2023-07-05 Thread Yu Jin
Am Di., 4. Juli 2023 um 15:42 Uhr schrieb Pavel Sanda:

> On Tue, Jul 04, 2023 at 10:55:14AM +0200, Yu Jin wrote:
> > Am Di., 4. Juli 2023 um 10:40 Uhr schrieb Jürgen Spitzmüller:
> >
> > > Am Dienstag, dem 04.07.2023 um 10:33 +0200 schrieb Yu Jin:
> > > > How do you switch on Linux/MacOS? Or does it just follow the system
> > > > setting?
> > >
> > > It follows the system settings unless you use a dark style via cl
> > > switch.
>
> On linux systems where desktop manager does not do it automatically, you
> can use (in case of QT 5) qt5ct tool to set it up. E.g. you select fusion
> style and "darker" (or any other you might like) color scheme.
>
> Then before running lyx you set the environment variable
> QT_QPA_PLATFORMTHEME=qt5ct
> and that should work (tested on oldstable debian).
>
> > What if we make "fusion" style default on windows then? That would make
> > LyX's behavior the same as on Linux and MacOS.
>
> Given that you are now the principal maintainer of the windows port
> I think that's up to you to decide.
>
> Advantage of fusion is that it will look the same across platform
> disadvantage might be that it looks less native to windows than
> other apps on your desktop?
>

Actually Qt blog says that "their" preferred style on Windows is fusion
¯\_(ツ)_/¯.

So would that be something we want to set on all platforms? or only Windows?
I attached 2 patches accordingly, the style can be overwritten by the user
through command line arguments as before.

Which one should I push?
-- 
  Eugene


0001-set-default-application-style-to-fusion-on-Windows.patch
Description: Binary data


0001-set-default-application-style-to-fusion.patch
Description: Binary data
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Windows Dark Mode and "fusion" style

2023-07-04 Thread Richard Kimberly Heck

On 7/4/23 09:41, Pavel Sanda wrote:

On Tue, Jul 04, 2023 at 10:55:14AM +0200, Yu Jin wrote:

Am Di., 4. Juli 2023 um 10:40 Uhr schrieb Jürgen Spitzmüller:


Am Dienstag, dem 04.07.2023 um 10:33 +0200 schrieb Yu Jin:

How do you switch on Linux/MacOS? Or does it just follow the system
setting?

It follows the system settings unless you use a dark style via cl
switch.

On linux systems where desktop manager does not do it automatically, you
can use (in case of QT 5) qt5ct tool to set it up. E.g. you select fusion
style and "darker" (or any other you might like) color scheme.

Then before running lyx you set the environment variable
QT_QPA_PLATFORMTHEME=qt5ct
and that should work (tested on oldstable debian).


Something like this might go into the release notes, and onto the wiki.

Riki


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


Re: Windows Dark Mode and "fusion" style

2023-07-04 Thread Pavel Sanda
On Tue, Jul 04, 2023 at 10:55:14AM +0200, Yu Jin wrote:
> Am Di., 4. Juli 2023 um 10:40 Uhr schrieb Jürgen Spitzmüller:
> 
> > Am Dienstag, dem 04.07.2023 um 10:33 +0200 schrieb Yu Jin:
> > > How do you switch on Linux/MacOS? Or does it just follow the system
> > > setting?
> >
> > It follows the system settings unless you use a dark style via cl
> > switch.

On linux systems where desktop manager does not do it automatically, you
can use (in case of QT 5) qt5ct tool to set it up. E.g. you select fusion
style and "darker" (or any other you might like) color scheme.

Then before running lyx you set the environment variable
QT_QPA_PLATFORMTHEME=qt5ct
and that should work (tested on oldstable debian).

> What if we make "fusion" style default on windows then? That would make
> LyX's behavior the same as on Linux and MacOS.

Given that you are now the principal maintainer of the windows port
I think that's up to you to decide.

Advantage of fusion is that it will look the same across platform
disadvantage might be that it looks less native to windows than
other apps on your desktop?

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


Re: Windows Dark Mode and "fusion" style

2023-07-04 Thread Jürgen Spitzmüller
Am Dienstag, dem 04.07.2023 um 10:55 +0200 schrieb Yu Jin:
> What if we make "fusion" style default on windows then? That would
> make LyX's behavior the same as on Linux and MacOS.

I am not the one to judge this. Never saw LyX on Windows.

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


Re: Windows Dark Mode and "fusion" style

2023-07-04 Thread Yu Jin
Am Di., 4. Juli 2023 um 10:40 Uhr schrieb Jürgen Spitzmüller:

> Am Dienstag, dem 04.07.2023 um 10:33 +0200 schrieb Yu Jin:
> > How do you switch on Linux/MacOS? Or does it just follow the system
> > setting?
>
> It follows the system settings unless you use a dark style via cl
> switch.


What if we make "fusion" style default on windows then? That would make
LyX's behavior the same as on Linux and MacOS.
-- 
  Eugene
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Windows Dark Mode and "fusion" style

2023-07-04 Thread Jürgen Spitzmüller
Am Dienstag, dem 04.07.2023 um 10:33 +0200 schrieb Yu Jin:
> How do you switch on Linux/MacOS? Or does it just follow the system
> setting?

It follows the system settings unless you use a dark style via cl
switch.

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


Re: Windows Dark Mode and "fusion" style

2023-07-04 Thread Yu Jin
Am Di., 4. Juli 2023 um 09:59 Uhr schrieb Jürgen Spitzmüller:

> Am Dienstag, dem 04.07.2023 um 08:46 +0200 schrieb Yu Jin:
> > Do we have a setting for switching to fusion style and/or toggling
> > dark mode on/off?
>
> No. A setting that let's you chose "System Settings/Dark/Light" would
> be good, but it's not trivial to implement AFAICS.
>

How do you switch on Linux/MacOS? Or does it just follow the system setting?
-- 
  Eugene
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Windows Dark Mode and "fusion" style

2023-07-04 Thread Jürgen Spitzmüller
Am Dienstag, dem 04.07.2023 um 08:46 +0200 schrieb Yu Jin:
> Do we have a setting for switching to fusion style and/or toggling
> dark mode on/off?

No. A setting that let's you chose "System Settings/Dark/Light" would
be good, but it's not trivial to implement AFAICS.

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