20 changed files with 144 additions and 74 deletions
@ -0,0 +1,28 @@ |
|||||
|
import QtQuick 2.10 |
||||
|
import QtQuick.Controls 2.3 |
||||
|
import QtQuick.Controls.Material 2.3 |
||||
|
import QtQuick.Controls.Universal 2.3 |
||||
|
import de.skycoder42.QtMvvm.Quick 1.1 |
||||
|
|
||||
|
Control { |
||||
|
id: _colorHelper |
||||
|
visible: false |
||||
|
|
||||
|
readonly property color highlight: { |
||||
|
if(QuickPresenter.currentStyle === "Material") |
||||
|
return Material.accent; |
||||
|
else if(QuickPresenter.currentStyle === "Universal") |
||||
|
return Universal.accent; |
||||
|
else |
||||
|
return palette.highlight; |
||||
|
} |
||||
|
|
||||
|
readonly property color text: { |
||||
|
if(QuickPresenter.currentStyle === "Material") |
||||
|
return Material.foreground; |
||||
|
else if(QuickPresenter.currentStyle === "Universal") |
||||
|
return Universal.foreground; |
||||
|
else |
||||
|
return palette.windowText; |
||||
|
} |
||||
|
} |
@ -0,0 +1,26 @@ |
|||||
|
import QtQuick 2.10 |
||||
|
import QtQuick.Controls 2.3 |
||||
|
import QtQuick.Controls.Material 2.3 |
||||
|
import de.skycoder42.QtMvvm.Quick 1.1 |
||||
|
|
||||
|
/*! @brief An extension of the @ref QtQuick.Controls.ToolBar "ToolBar" for better appearance |
||||
|
* |
||||
|
* @extends QtQuick.Controls.ToolBar |
||||
|
* |
||||
|
* @details This version basically adjusts size and text color of the toolbar itself and |
||||
|
* controls within the toolbar to look better and improve contrast |
||||
|
* |
||||
|
* @sa ActionButton, ToolBarLabel, MenuButton |
||||
|
*/ |
||||
|
ToolBar { |
||||
|
id: _contrastToolBar |
||||
|
|
||||
|
height: 56 |
||||
|
|
||||
|
// @copydoc QuickPresenter::accentTextColor |
||||
|
function accentTextColor(accentColor, baseColor) { |
||||
|
return QuickPresenter.accentTextColor(accentColor, baseColor); |
||||
|
} |
||||
|
|
||||
|
Material.foreground: QuickPresenter.accentTextColor(Material.primary, Material.foreground) |
||||
|
} |
@ -1,25 +1,18 @@ |
|||||
import QtQuick 2.10 |
import QtQuick 2.10 |
||||
import QtQuick.Controls 2.3 |
import QtQuick.Controls 2.3 |
||||
import QtQuick.Controls.Material 2.3 |
|
||||
import QtQuick.Controls.Universal 2.3 |
|
||||
import de.skycoder42.QtMvvm.Quick 1.1 |
import de.skycoder42.QtMvvm.Quick 1.1 |
||||
|
|
||||
Label { |
Label { |
||||
id: _decorLabel |
id: _decorLabel |
||||
|
|
||||
|
ColorHelper { |
||||
|
id: helper |
||||
|
} |
||||
|
|
||||
property Item edit: _decorLabel.nextItemInFocusChain() |
property Item edit: _decorLabel.nextItemInFocusChain() |
||||
|
|
||||
readonly property bool editHasFocus: edit && edit.focus |
readonly property bool editHasFocus: edit && edit.focus |
||||
|
|
||||
function highlightColor() { |
color: editHasFocus ? helper.highlight : helper.text |
||||
if(QuickPresenter.currentStyle === "Material") |
|
||||
return Material.accentColor; |
|
||||
else if(QuickPresenter.currentStyle === "Universal") |
|
||||
return Universal.accent; |
|
||||
else |
|
||||
return palette.highlight; |
|
||||
} |
|
||||
|
|
||||
color: editHasFocus ? highlightColor() : palette.text |
|
||||
opacity: editHasFocus ? 1 : 0.5 |
opacity: editHasFocus ? 1 : 0.5 |
||||
} |
} |
||||
|
Loading…
Reference in new issue