summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
Diffstat (limited to 'vcl')
-rw-r--r--vcl/inc/qt5/QtInstanceEntry.hxx1
-rw-r--r--vcl/inc/salvtables.hxx2
-rw-r--r--vcl/osx/salprn.cxx11
-rw-r--r--vcl/qt5/QtInstanceEntry.cxx7
-rw-r--r--vcl/source/app/salvtables.cxx5
-rw-r--r--vcl/unx/gtk3/custom-theme.cxx20
-rw-r--r--vcl/unx/gtk3/gtkinst.cxx5
-rw-r--r--vcl/unx/gtk3/salnativewidgets-gtk.cxx18
-rw-r--r--vcl/win/dtrans/MtaOleClipb.cxx30
9 files changed, 53 insertions, 46 deletions
diff --git a/vcl/inc/qt5/QtInstanceEntry.hxx b/vcl/inc/qt5/QtInstanceEntry.hxx
index b7b1ef162d6a..32baf0c4ef6e 100644
--- a/vcl/inc/qt5/QtInstanceEntry.hxx
+++ b/vcl/inc/qt5/QtInstanceEntry.hxx
@@ -34,6 +34,7 @@ public:
virtual int get_position() const override;
virtual void set_editable(bool bEditable) override;
virtual bool get_editable() const override;
+ virtual void set_visibility(bool bVisible) override;
virtual void set_message_type(weld::EntryMessageType eType) override;
virtual void set_placeholder_text(const OUString& rText) override;
diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx
index 464fc72afb4f..e9bdf6245070 100644
--- a/vcl/inc/salvtables.hxx
+++ b/vcl/inc/salvtables.hxx
@@ -639,6 +639,8 @@ public:
virtual bool get_editable() const override;
+ virtual void set_visibility(bool bVisible) override;
+
virtual void set_overwrite_mode(bool bOn) override;
virtual bool get_overwrite_mode() const override;
diff --git a/vcl/osx/salprn.cxx b/vcl/osx/salprn.cxx
index 1c45b71eb384..9baababcc146 100644
--- a/vcl/osx/salprn.cxx
+++ b/vcl/osx/salprn.cxx
@@ -216,21 +216,17 @@ void AquaSalInfoPrinter::setPaperSize( tools::Long i_nWidth, tools::Long i_nHeig
Orientation ePaperOrientation = Orientation::Portrait;
const PaperInfo* pPaper = matchPaper( i_nWidth, i_nHeight, ePaperOrientation );
- bool bPaperSet = false;
-
if( pPaper )
{
- // If the paper name is empty, fallback to setting the paper size
- // using the specified width and height.
+ // Don't set the print info's paper name if it is empty
const rtl::OString rPaperName( PaperInfo::toPSName( pPaper->getPaper() ) );
if( !rPaperName.isEmpty() )
{
NSString* pPaperName = [CreateNSString( OStringToOUString( rPaperName, RTL_TEXTENCODING_ASCII_US ) ) autorelease];
[mpPrintInfo setPaperName: pPaperName];
- bPaperSet = true;
}
}
- if( !bPaperSet && i_nWidth > 0 && i_nHeight > 0 )
+ if( i_nWidth > 0 && i_nHeight > 0 )
{
NSSize aPaperSize = { static_cast<CGFloat>(TenMuToPt(i_nWidth)), static_cast<CGFloat>(TenMuToPt(i_nHeight)) };
[mpPrintInfo setPaperSize: aPaperSize];
@@ -522,7 +518,8 @@ bool AquaSalInfoPrinter::StartJob( const OUString* i_pFileName,
// When the last page has a page size change, one more loop
// still needs to run so set mnCurPageRangeCount to zero.
- mnCurPageRangeStart += mnCurPageRangeCount;
+ if( !aAccViewState.bNeedRestart )
+ mnCurPageRangeStart += mnCurPageRangeCount;
mnCurPageRangeCount = 0;
} while( ( !bWasAborted || aAccViewState.bNeedRestart ) && mnCurPageRangeStart + mnCurPageRangeCount < nAllPages );
}
diff --git a/vcl/qt5/QtInstanceEntry.cxx b/vcl/qt5/QtInstanceEntry.cxx
index 88f7a181f9f0..bb27c84b6083 100644
--- a/vcl/qt5/QtInstanceEntry.cxx
+++ b/vcl/qt5/QtInstanceEntry.cxx
@@ -120,6 +120,13 @@ bool QtInstanceEntry::get_editable() const
return bEditable;
}
+void QtInstanceEntry::set_visibility(bool bVisible)
+{
+ SolarMutexGuard g;
+ GetQtInstance().RunInMainThread(
+ [&] { m_pLineEdit->setEchoMode(!bVisible ? QLineEdit::Password : QLineEdit::Normal); });
+}
+
void QtInstanceEntry::setMessageType(QLineEdit& rLineEdit, weld::EntryMessageType eType)
{
SolarMutexGuard g;
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 2b3448ae0b02..cca696e6245d 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -3454,6 +3454,11 @@ void SalInstanceEntry::set_editable(bool bEditable) { m_xEntry->SetReadOnly(!bEd
bool SalInstanceEntry::get_editable() const { return !m_xEntry->IsReadOnly(); }
+void SalInstanceEntry::set_visibility(bool bVisible)
+{
+ m_xEntry->set_property(u"visibility"_ustr, OUString::boolean(bVisible));
+}
+
void SalInstanceEntry::set_overwrite_mode(bool bOn) { m_xEntry->SetInsertMode(!bOn); }
bool SalInstanceEntry::get_overwrite_mode() const { return !m_xEntry->IsInsertMode(); }
diff --git a/vcl/unx/gtk3/custom-theme.cxx b/vcl/unx/gtk3/custom-theme.cxx
index f7892bd68568..13dcad562b1c 100644
--- a/vcl/unx/gtk3/custom-theme.cxx
+++ b/vcl/unx/gtk3/custom-theme.cxx
@@ -195,7 +195,7 @@ OString CreateStyleString()
"}"
"treeview.view.expander:disabled {"
- " color: #" + aThemeColors.GetInactiveColor().AsRGBHexString() + ";"
+ " color: #" + aThemeColors.GetDisabledColor().AsRGBHexString() + ";"
"}"
// this part is still left
@@ -209,7 +209,7 @@ OString CreateStyleString()
"treeview.view header button,"
"treeview.view header button:disabled {"
- " background-color: #" + aThemeColors.GetInactiveColor().AsRGBHexString() + ";"
+ " background-color: #" + aThemeColors.GetDisabledColor().AsRGBHexString() + ";"
"}"
"treeview.view header button:last-child {"
@@ -342,7 +342,7 @@ OString CreateStyleString()
"}"
"scrollbar slider:disabled {"
- " background-color: #" + aThemeColors.GetInactiveColor().AsRGBHexString() + ";"
+ " background-color: #" + aThemeColors.GetDisabledColor().AsRGBHexString() + ";"
"}"
"scrollbar.overlay-indicator:not(.dragging):not(.hovering) {"
@@ -353,9 +353,15 @@ OString CreateStyleString()
* Check n Radio *
* ***************/
+ "check,"
+ "radio {"
+ " background-image: none;"
+ " border: 1px solid #" + aThemeColors.GetSeparatorColor().AsRGBHexString() + ";"
+ "}"
+
"check:disabled,"
"radio:disabled {"
- " background-color: #" + aThemeColors.GetInactiveColor().AsRGBHexString() + ";"
+ " background-color: #" + aThemeColors.GetDisabledColor().AsRGBHexString() + ";"
"}"
"check:checked,"
@@ -387,7 +393,7 @@ OString CreateStyleString()
"radio:checked:disabled,"
"radio:indeterminate:disabled {"
" color: rgba(17, 17, 27, 0.38);"
- " background-color: #" + aThemeColors.GetInactiveColor().AsRGBHexString() + ";"
+ " background-color: #" + aThemeColors.GetDisabledColor().AsRGBHexString() + ";"
"}"
/***************
@@ -453,7 +459,7 @@ OString CreateStyleString()
"}"
"button:disabled {"
- " background-color: #" + aThemeColors.GetInactiveColor().AsRGBHexString() + ";"
+ " background-color: #" + aThemeColors.GetDisabledColor().AsRGBHexString() + ";"
" color: #" + aThemeColors.GetInactiveTextColor().AsRGBHexString() + ";"
" border: 1px solid #" + aThemeColors.GetInactiveBorderColor().AsRGBHexString() + ";"
"}"
@@ -516,7 +522,7 @@ OString CreateStyleString()
"button.combo:only-child:disabled {"
" box-shadow: 0 0 0 2px transparent;"
- " background-color: #" + aThemeColors.GetInactiveColor().AsRGBHexString() + ";"
+ " background-color: #" + aThemeColors.GetDisabledColor().AsRGBHexString() + ";"
" color: #" + aThemeColors.GetInactiveTextColor().AsRGBHexString() + ";"
"}"
diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index e79147651d10..2550c134b356 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -13467,6 +13467,11 @@ public:
return gtk_editable_get_editable(m_pEditable);
}
+ virtual void set_visibility(bool bVisible) override
+ {
+ gtk_entry_set_visibility(GTK_ENTRY(m_pDelegate), bVisible);
+ }
+
virtual void set_overwrite_mode(bool bOn) override
{
#if GTK_CHECK_VERSION(4, 0, 0)
diff --git a/vcl/unx/gtk3/salnativewidgets-gtk.cxx b/vcl/unx/gtk3/salnativewidgets-gtk.cxx
index fb8041c74e6d..c3bbda65728f 100644
--- a/vcl/unx/gtk3/salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk3/salnativewidgets-gtk.cxx
@@ -1394,6 +1394,7 @@ GtkStyleContext* GtkSalGraphics::createStyleContext(GtkControlPart ePart)
GtkWidgetPath *path = gtk_widget_path_copy(gtk_style_context_get_path(mpWindowStyle));
gtk_widget_path_append_type(path, GTK_TYPE_MENU_BAR);
gtk_widget_path_iter_set_object_name(path, -1, "menubar");
+ gtk_widget_path_iter_add_class(path, -1, "background");
return makeContext(path, mpWindowStyle);
}
case GtkControlPart::MenuBarItem:
@@ -2337,6 +2338,7 @@ bool GtkSalGraphics::updateSettings(AllSettings& rSettings)
// background colors
::Color aBackColor = style_context_get_background_color(pStyle);
aStyleSet.BatchSetBackgrounds( aBackColor );
+ aStyleSet.SetWindowColor(aBackColor);
// UI font
#if GTK_CHECK_VERSION(4, 0, 0)
@@ -2435,6 +2437,7 @@ bool GtkSalGraphics::updateSettings(AllSettings& rSettings)
::Color aHighlightTextColor = getColor( text_color );
aStyleSet.SetAccentColor( aHighlightColor ); // https://debugpointnews.com/gnome-native-accent-colour-announcement/
aStyleSet.SetHighlightColor( aHighlightColor );
+ aStyleSet.SetMenuHighlightColor( aHighlightColor );
aStyleSet.SetHighlightTextColor( aHighlightTextColor );
aStyleSet.SetListBoxWindowHighlightColor( aHighlightColor );
aStyleSet.SetListBoxWindowHighlightTextColor( aHighlightTextColor );
@@ -2449,8 +2452,6 @@ bool GtkSalGraphics::updateSettings(AllSettings& rSettings)
style_context_set_state(pCStyle, GTK_STATE_FLAG_NORMAL);
::Color aBackFieldColor = style_context_get_background_color(pCStyle);
aStyleSet.SetFieldColor( aBackFieldColor );
- // This baby is the default page/paper color
- aStyleSet.SetWindowColor( aBackFieldColor );
// listbox background color
aStyleSet.SetListBoxWindowBackgroundColor( aBackFieldColor );
@@ -2478,6 +2479,13 @@ bool GtkSalGraphics::updateSettings(AllSettings& rSettings)
aShadowColor.DecreaseLuminance(64);
aStyleSet.SetShadowColor(aShadowColor);
+ ::Color aDisabledColor(aBackFieldColor);
+ if (aBackFieldColor.GetLuminance() > aBackColor.GetLuminance())
+ aDisabledColor.IncreaseLuminance(8);
+ else
+ aDisabledColor.DecreaseLuminance(8);
+ aStyleSet.SetDisableColor(aDisabledColor);
+
aContextState.restore();
#if !GTK_CHECK_VERSION(4, 0, 0)
g_object_unref( pCStyle );
@@ -2504,6 +2512,9 @@ bool GtkSalGraphics::updateSettings(AllSettings& rSettings)
style_context_set_state(mpMenuBarStyle, GTK_STATE_FLAG_NORMAL);
aBackColor = style_context_get_background_color(mpMenuBarStyle);
aStyleSet.SetMenuBarColor( aBackColor );
+
+ style_context_set_state(mpMenuBarStyle, GTK_STATE_FLAG_SELECTED);
+ aBackColor = style_context_get_background_color(mpMenuBarStyle);
aStyleSet.SetMenuBarRolloverColor( aBackColor );
style_context_set_state(mpMenuBarItemStyle, GTK_STATE_FLAG_NORMAL);
@@ -2524,9 +2535,6 @@ bool GtkSalGraphics::updateSettings(AllSettings& rSettings)
aStyleSet.SetMenuTextColor(aTextColor);
style_context_set_state(mpMenuItemLabelStyle, GTK_STATE_FLAG_PRELIGHT);
- ::Color aHighlightColor = style_context_get_background_color(mpMenuItemLabelStyle);
- aStyleSet.SetMenuHighlightColor( aHighlightColor );
-
style_context_get_color(mpMenuItemLabelStyle, &color);
::Color aHighlightTextColor = getColor( color );
aStyleSet.SetMenuHighlightTextColor( aHighlightTextColor );
diff --git a/vcl/win/dtrans/MtaOleClipb.cxx b/vcl/win/dtrans/MtaOleClipb.cxx
index 9417f3053c28..98c9d1ac578e 100644
--- a/vcl/win/dtrans/MtaOleClipb.cxx
+++ b/vcl/win/dtrans/MtaOleClipb.cxx
@@ -45,6 +45,7 @@
#include <systools/win32/comtools.hxx>
#include <systools/win32/retry_if_failed.hxx>
+#include <systools/win32/wait_for_multiple_objects.hxx>
#include <comphelper/windowserrorstring.hxx>
@@ -66,13 +67,7 @@ namespace /* private */
const bool MANUAL_RESET = true;
const bool INIT_NONSIGNALED = false;
- /* Cannot use osl conditions because they are blocking
- without waking up on messages sent by another thread
- this leads to deadlocks because we are blocking the
- communication between inter-thread marshalled COM
- pointers.
- COM Proxy-Stub communication uses SendMessages for
- synchronization purposes.
+ /* Similar to osl conditions, with two condition objects passed to the Wait function.
*/
class Win32Condition
{
@@ -86,33 +81,14 @@ namespace /* private */
bool wait(HANDLE hEvtAbort)
{
const HANDLE hWaitArray[2] = { m_hEvent, hEvtAbort };
- while (true)
+ switch (sal::systools::WaitForMultipleObjects_COMDispatch(2, hWaitArray, INFINITE))
{
- DWORD dwResult
- = MsgWaitForMultipleObjects(2, hWaitArray, FALSE, INFINITE, QS_SENDMESSAGE);
-
- switch (dwResult)
- {
case WAIT_OBJECT_0: // wait successful
return true;
case WAIT_OBJECT_0 + 1: // wait aborted
- return false;
-
- case WAIT_OBJECT_0 + 2:
- {
- /* PeekMessage processes all messages in the SendMessage
- queue that's what we want, messages from the PostMessage
- queue stay untouched */
- MSG msg;
- PeekMessageW(&msg, nullptr, 0, 0, PM_NOREMOVE);
-
- break;
- }
-
default: // WAIT_FAILED?
return false;
- }
}
}