mirror of
https://github.com/Ximi1970/systray-x.git
synced 2025-11-07 22:06:02 +01:00
Fix, cleanup
This commit is contained in:
@@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>692</width>
|
||||
<height>310</height>
|
||||
<width>676</width>
|
||||
<height>278</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@@ -20,172 +20,6 @@
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<item row="0" column="0">
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="0" column="0" rowspan="2">
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Windows</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<widget class="QRadioButton" name="defaultMinimizeRadioButton">
|
||||
<property name="text">
|
||||
<string>Default minimize</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">minimizeTypeGroup</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="minimizeMethod1RadioButton">
|
||||
<property name="text">
|
||||
<string>Minimize to tray, method 1</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">minimizeTypeGroup</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="minimizeMethod2RadioButton">
|
||||
<property name="text">
|
||||
<string>Minimize to tray, method 2</string>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">minimizeTypeGroup</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="startMinimizedCheckBox">
|
||||
<property name="text">
|
||||
<string>Start application minimized</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QGroupBox" name="iconTypeGroupBox">
|
||||
<property name="title">
|
||||
<string>Mail notification icon</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetFixedSize</enum>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="blankRadioButton">
|
||||
<property name="text">
|
||||
<string>Blank icon</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">iconTypeGroup</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetFixedSize</enum>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="newMailButton">
|
||||
<property name="text">
|
||||
<string>New mail icon</string>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">iconTypeGroup</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetMaximumSize</enum>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="customRadioButton">
|
||||
<property name="text">
|
||||
<string>Custom icon</string>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">iconTypeGroup</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="imageLabel">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="chooseCustomButton">
|
||||
<property name="text">
|
||||
<string>Choose</string>
|
||||
</property>
|
||||
<property name="flat">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<property name="title">
|
||||
@@ -299,6 +133,181 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QGroupBox" name="iconTypeGroupBox">
|
||||
<property name="title">
|
||||
<string>Mail notification icon</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetFixedSize</enum>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="blankRadioButton">
|
||||
<property name="text">
|
||||
<string>Blank icon</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">iconTypeGroup</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetFixedSize</enum>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="newMailButton">
|
||||
<property name="text">
|
||||
<string>New mail icon</string>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">iconTypeGroup</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetMaximumSize</enum>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="customRadioButton">
|
||||
<property name="text">
|
||||
<string>Custom icon</string>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">iconTypeGroup</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="imageLabel">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="chooseCustomButton">
|
||||
<property name="text">
|
||||
<string>Choose</string>
|
||||
</property>
|
||||
<property name="flat">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" rowspan="2">
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Windows</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_4">
|
||||
<property name="title">
|
||||
<string>Minimize</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<widget class="QRadioButton" name="defaultMinimizeRadioButton">
|
||||
<property name="text">
|
||||
<string>Default minimize</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">minimizeTypeGroup</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="minimizeMethod1RadioButton">
|
||||
<property name="text">
|
||||
<string>Minimize to tray, method 1</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">minimizeTypeGroup</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="minimizeMethod2RadioButton">
|
||||
<property name="text">
|
||||
<string>Minimize to tray, method 2</string>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">minimizeTypeGroup</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="startMinimizedCheckBox">
|
||||
<property name="text">
|
||||
<string>Start application minimized</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
|
||||
@@ -286,28 +286,9 @@ void WindowCtrlUnix::minimizeWindow( quint64 window, int hide )
|
||||
return;
|
||||
}
|
||||
|
||||
switch( hide )
|
||||
{
|
||||
case Preferences::PREF_MINIMIZE_METHOD_1:
|
||||
{
|
||||
hideWindowEvent( window, hide );
|
||||
break;
|
||||
}
|
||||
|
||||
case Preferences::PREF_MINIMIZE_METHOD_2:
|
||||
{
|
||||
hideWindowAtom( window, hide );
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
hideWindow( window, hide );
|
||||
|
||||
XIconifyWindow( m_display, static_cast<Window>( window ), m_screen );
|
||||
|
||||
XFlush( m_display );
|
||||
}
|
||||
|
||||
@@ -317,7 +298,7 @@ void WindowCtrlUnix::minimizeWindow( quint64 window, int hide )
|
||||
*/
|
||||
void WindowCtrlUnix::hideWindow( quint64 window, int set )
|
||||
{
|
||||
switch( set )
|
||||
switch( m_minimize_type )
|
||||
{
|
||||
case Preferences::PREF_MINIMIZE_METHOD_1:
|
||||
{
|
||||
@@ -339,7 +320,6 @@ void WindowCtrlUnix::hideWindow( quint64 window, int set )
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Normalize a window
|
||||
*/
|
||||
|
||||
@@ -72,12 +72,11 @@ void WindowCtrl::slotWindowTest2()
|
||||
emit signalConsole("Test 2 started");
|
||||
|
||||
// Do something.
|
||||
hideWindow( getWinId(), true );
|
||||
|
||||
// findWindow( m_ppid );
|
||||
// emit signalConsole( QString( "Hwnd ppid: %1" ).arg( getWinIds()[0] ) );
|
||||
|
||||
hideWindow( getWinId(), true );
|
||||
|
||||
emit signalConsole("Test 2 done");
|
||||
}
|
||||
|
||||
|
||||
@@ -382,10 +382,16 @@ async function start() {
|
||||
SysTrayX.platformInfo = await browser.runtime
|
||||
.getPlatformInfo()
|
||||
.then((info) => info);
|
||||
|
||||
console.log("OS: " + SysTrayX.platformInfo.os);
|
||||
console.log("Arch: " + SysTrayX.platformInfo.arch);
|
||||
console.log("Nack-Arch: " + SysTrayX.platformInfo.nacl_arch);
|
||||
|
||||
// Store platform info
|
||||
browser.storage.sync.set({
|
||||
platformInfo: SysTrayX.platformInfo,
|
||||
});
|
||||
|
||||
// Get addon version
|
||||
SysTrayX.version = browser.runtime.getManifest().version;
|
||||
console.log("Addon version: " + SysTrayX.version);
|
||||
|
||||
@@ -63,14 +63,14 @@ body {
|
||||
#minimizeselect {
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
margin: 10px 10px 10px 10px;
|
||||
margin: 10px 10px 10px 10px;
|
||||
padding: 10px 10px 10px 10px;
|
||||
}
|
||||
|
||||
#iconselect {
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
margin: 10px 10px 10px 10px;
|
||||
margin: 10px 10px 10px 10px;
|
||||
padding: 10px 10px 10px 10px;
|
||||
}
|
||||
|
||||
|
||||
@@ -150,7 +150,10 @@ SysTrayX.RestoreOptions = {
|
||||
//
|
||||
// Restore minimize type
|
||||
//
|
||||
const getMinimizeType = browser.storage.sync.get("minimizeType");
|
||||
const getMinimizeType = browser.storage.sync.get([
|
||||
"platformInfo",
|
||||
"minimizeType",
|
||||
]);
|
||||
getMinimizeType.then(
|
||||
SysTrayX.RestoreOptions.setMinimizeType,
|
||||
SysTrayX.RestoreOptions.onMinimizeTypeError
|
||||
@@ -238,7 +241,22 @@ SysTrayX.RestoreOptions = {
|
||||
// Restore minimize type callbacks
|
||||
//
|
||||
setMinimizeType: function (result) {
|
||||
const platformInfo = result.platformInfo || { os: "linux" };
|
||||
const minimizeType = result.minimizeType || "1";
|
||||
|
||||
// Tweak option for platform
|
||||
if (platformInfo.os === "win") {
|
||||
document.getElementById("minimizemethod1label").innerHTML =
|
||||
"Minimize to tray";
|
||||
document
|
||||
.getElementById("minimizemethod2")
|
||||
.setAttribute("style", "display:none;");
|
||||
|
||||
if (minimizeType === "2") {
|
||||
minimizeType = "1";
|
||||
}
|
||||
}
|
||||
|
||||
const radioButton = document.querySelector(
|
||||
`input[name="minimizeType"][value="${minimizeType}"]`
|
||||
);
|
||||
@@ -461,27 +479,6 @@ SysTrayX.StorageChanged = {
|
||||
// Main
|
||||
//
|
||||
|
||||
// Set platform
|
||||
//SysTrayX.platformInfo = await browser.runtime
|
||||
// .getPlatformInfo()
|
||||
// .then((info) => info);
|
||||
/*
|
||||
// Tweak options for platform
|
||||
if (SysTrayX.platformInfo.os === "win") {
|
||||
console.debug("Win");
|
||||
}
|
||||
|
||||
if (SysTrayX.platformInfo.os === "linux") {
|
||||
console.debug("Linux");
|
||||
}
|
||||
*/
|
||||
|
||||
document.getElementById("minimizemethod1label").innerHTML =
|
||||
"Minimize to tray";
|
||||
document
|
||||
.getElementById("minimizemethod2")
|
||||
.setAttribute("style", "display:none;");
|
||||
|
||||
// Get addon version
|
||||
SysTrayX.version = browser.runtime.getManifest().version;
|
||||
document.getElementById("VersioHomeLink").href =
|
||||
@@ -493,4 +490,3 @@ document
|
||||
.addEventListener("submit", SysTrayX.SaveOptions.start);
|
||||
|
||||
browser.storage.onChanged.addListener(SysTrayX.StorageChanged.changed);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user