Création d'un compte pour un collaborateur extérieur au laboratoire depuis l'intranet ICube : https://intranet.icube.unistra.fr/fr/labs/member/profile

Commit 20cde100 authored by Frédéric Larue's avatar Frédéric Larue
Browse files

StyleSheet management revisited.

parent 5a06efed
......@@ -11,90 +11,6 @@
QApplication* UICreateApplication( int argc, char **argv )
{
#ifdef _WIN32
_CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF /*| _CRTDBG_CHECK_ALWAYS_DF*/ );
#endif
QSurfaceFormat format;
format.setRenderableType( QSurfaceFormat::OpenGL ); // OpenGL renderable surface.
format.setProfile( QSurfaceFormat::CompatibilityProfile ); // Ensure compatibility with former OpenGL versions.
format.setVersion( 2, 1 ); // Set the prefered OpenGL version.
format.setSwapBehavior( QSurfaceFormat::DoubleBuffer ); // Enable double buffering.
format.setSamples( 8 ); // Desired # of samples when multi-sampling is enabled.
format.setRedBufferSize ( 8 ); // Red channel size in bits.
format.setGreenBufferSize( 8 ); // Green channel size in bits.
format.setBlueBufferSize ( 8 ); // Blue channel size in bits.
//format.setAlphaBufferSize( 8 ); // Alpha channel size in bits.
format.setDepthBufferSize( 24 ); // Depth buffer channel size in bits.
format.setStencilBufferSize( 8 ); // Stencil buffer size in bits.
format.setSwapInterval( 0 ); // Disable VSync.
QSurfaceFormat::setDefaultFormat( format );
// Launch the Qt GUI.
QApplication::setAttribute( Qt::AA_UseDesktopOpenGL, true );
QApplication::setAttribute( Qt::AA_ShareOpenGLContexts, true );
QApplication *app = new QApplication( argc, argv );
app->setFont( QFont("Calibri",9) );
QFile cssFile( QApplication::applicationDirPath() + "/themes/Default.css" );
if( cssFile.open( QIODevice::ReadOnly | QIODevice::Text ) )
{
uchar *cssContent = cssFile.map( 0, cssFile.size() );
app->setStyleSheet( (char*) cssContent );
cssFile.unmap( cssContent );
cssFile.close();
}
QPalette palette = app->palette();
for( int i=0; i<3; i+=2 )
{
palette.setColor( (QPalette::ColorGroup)i, QPalette::Window , QColor( 64, 64, 72 /*80*/) );
palette.setColor( (QPalette::ColorGroup)i, QPalette::WindowText , QColor(160,192,255) );//QColor(220,220,255) );
//palette.setColor( (QPalette::ColorGroup)i, QPalette::WindowText , QColor(255,192,0) );//QColor(220,220,255) );
palette.setColor( (QPalette::ColorGroup)i, QPalette::Text , QColor(160,192,255) );
//palette.setColor( (QPalette::ColorGroup)i, QPalette::ToolTipText, QColor(220,220,255) );
//palette.setColor( (QPalette::ColorGroup)i, QPalette::HighlightedText, QColor(220,220,255) );
palette.setColor( (QPalette::ColorGroup)i, QPalette::BrightText, QColor(220,220,255) );
//palette.setColor( (QPalette::ColorGroup)i, QPalette::Dark, QColor(220,220,255) );
//palette.setColor( (QPalette::ColorGroup)i, QPalette::Shadow, QColor(220,220,255) );
palette.setColor( (QPalette::ColorGroup)i, QPalette::Base , QColor( 48, 48, 64) );
palette.setColor( (QPalette::ColorGroup)i, QPalette::ButtonText , QColor(220,230,255) );
palette.setColor( (QPalette::ColorGroup)i, QPalette::Button , QColor( 48, 48, 64) );
//palette.setColor( (QPalette::ColorGroup)i, QPalette::Mid , QColor( 255, 48, 64) );
//palette.setColor( (QPalette::ColorGroup)i, QPalette::Dark , QColor( 0, 255, 64) );
//palette.setColor( (QPalette::ColorGroup)i, QPalette::Mid , QColor( 255, 48, 64) );
}
app->setPalette( palette );
return app;
}
GUIMAIN_API int UIMainLoop( QApplication *app, UIMainWindow *mainWin )
{
mainWin->onInitializingApp();
mainWin->init();
mainWin->show();
int appRetVal = app->exec();
mainWin->release();
mainWin->onReleasingApp();
delete mainWin;
delete app;
return appRetVal;
}
#ifdef _WIN32
/*
......
......@@ -16,17 +16,75 @@
#include "UIMainWindow.h"
GUIMAIN_API QApplication* UICreateApplication( int argc, char **argv );
GUIMAIN_API int UIMainLoop( QApplication *app, UIMainWindow *mainWin );
template <typename UIMainWindowT>
int UILaunch( int argc, char **argv )
{
QApplication *app = UICreateApplication( argc, argv );
#ifdef _WIN32
_CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF /*| _CRTDBG_CHECK_ALWAYS_DF*/ );
#endif
QSurfaceFormat format;
format.setRenderableType( QSurfaceFormat::OpenGL ); // OpenGL renderable surface.
format.setProfile( QSurfaceFormat::CompatibilityProfile ); // Ensure compatibility with former OpenGL versions.
format.setVersion( 2, 1 ); // Set the prefered OpenGL version.
format.setSwapBehavior( QSurfaceFormat::DoubleBuffer ); // Enable double buffering.
format.setSamples( 8 ); // Desired # of samples when multi-sampling is enabled.
format.setRedBufferSize ( 8 ); // Red channel size in bits.
format.setGreenBufferSize( 8 ); // Green channel size in bits.
format.setBlueBufferSize ( 8 ); // Blue channel size in bits.
//format.setAlphaBufferSize( 8 ); // Alpha channel size in bits.
format.setDepthBufferSize( 24 ); // Depth buffer channel size in bits.
format.setStencilBufferSize( 8 ); // Stencil buffer size in bits.
format.setSwapInterval( 0 ); // Disable VSync.
QSurfaceFormat::setDefaultFormat( format );
// Launch the Qt GUI.
QApplication::setAttribute( Qt::AA_UseDesktopOpenGL, true );
QApplication::setAttribute( Qt::AA_ShareOpenGLContexts, true );
QApplication app( argc, argv );
app.setFont( QFont("Calibri",9) );
QPalette palette = app.palette();
for( int i=0; i<3; i+=2 )
{
palette.setColor( (QPalette::ColorGroup)i, QPalette::Window , QColor( 64, 64, 72) );
palette.setColor( (QPalette::ColorGroup)i, QPalette::WindowText , QColor(160,192,255) );
palette.setColor( (QPalette::ColorGroup)i, QPalette::Text , QColor(160,192,255) );
palette.setColor( (QPalette::ColorGroup)i, QPalette::BrightText , QColor(200,230,255) );
palette.setColor( (QPalette::ColorGroup)i, QPalette::ButtonText , QColor(200,230,255) );
palette.setColor( (QPalette::ColorGroup)i, QPalette::Button , QColor( 48, 48, 64) );
//palette.setColor( (QPalette::ColorGroup)i, QPalette::ToolTipText, QColor(220,220,255) );
//palette.setColor( (QPalette::ColorGroup)i, QPalette::HighlightedText, QColor(220,220,255) );
palette.setColor( (QPalette::ColorGroup)i, QPalette::Shadow , QColor( 0, 0, 0) );
palette.setColor( (QPalette::ColorGroup)i, QPalette::Base , QColor( 48, 48, 64) );
palette.setColor( (QPalette::ColorGroup)i, QPalette::Dark , QColor( 32, 32, 48) );
palette.setColor( (QPalette::ColorGroup)i, QPalette::Mid , QColor( 56, 56, 80) );
palette.setColor( (QPalette::ColorGroup)i, QPalette::Light , QColor( 96, 96,112) );
}
app.setPalette( palette );
QFile cssFile( ":/style/Default.css" );
if( cssFile.open( QIODevice::ReadOnly | QIODevice::Text ) )
{
app.setStyleSheet( QTextStream(&cssFile).readAll() );
cssFile.close();
}
UIMainWindow *mainWin = new UIMainWindowT(); // Use default GUI main window.
return UIMainLoop( app, mainWin );
mainWin->onInitializingApp();
mainWin->init();
mainWin->show();
int appRetVal = app.exec();
mainWin->release();
mainWin->onReleasingApp();
delete mainWin;
return appRetVal;
}
......
......@@ -26,4 +26,9 @@
<file>resources/AboutLicences/Licence.QT.html</file>
<file>resources/AboutLicences/Licence.ZLib.html</file>
</qresource>
<qresource prefix="/style">
<file alias="Default.css">resources/style/Default.css</file>
<file>resources/style/QCheckBox.png</file>
<file>resources/style/QRadioButton.png</file>
</qresource>
</RCC>
QPushButton[flat="false"], QScrollBar::handle, QToolTip, QHeaderView::section
{
border-top : 1px solid palette(light);
border-right : 1px solid palette(shadow);
border-bottom: 1px solid palette(shadow);
border-left : 1px solid palette(light);
}
QPushButton[flat="false"]:pressed, QComboBox, QLineEdit, QSpinBox, QDoubleSpinBox, QCheckBox::indicator, QRadioButton::indicator, QSlider::groove:horizontal, QHeaderView::section:pressed, QTreeView::indicator
{
border-top : 1px solid palette(shadow);
border-right : 1px solid palette(light);
border-bottom: 1px solid palette(light);
border-left : 1px solid palette(shadow);
}
QPushButton[flat="false"]
{
color: palette(text);
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 palette(window), stop: 0.35 palette(light), stop: 0.75 palette(base));
border-radius: 3px;
padding: 4 20 4 20;
}
QPushButton[flat="false"]:hover
{
color: palette(bright-text);
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 palette(window), stop: 0.35 palette(light), stop: 0.75 palette(mid));
}
QGroupBox
{
color: palette(bright-text);
border: 2px solid palette(bright-text);
border-radius: 5px;
margin-top: 0.5em;
padding: 5 2 2 2;
}
QGroupBox::title
{
subcontrol-origin: margin;
left: 20px;
padding: 0 2 0 3;
}
QGroupBox#UIParamChoice
{
border: 1px solid palette(text);
}
QComboBox, QLineEdit, QSpinBox, QDoubleSpinBox
{
color: palette(bright-text);
border-radius: 3px;
}
QComboBox:disabled, QLineEdit:disabled, QSpinBox:disabled, QDoubleSpinBox:disabled, QCheckBox::indicator:disabled, QRadioButton::indicator:disabled, QGroupBox:disabled, QGroupBox#UIParamChoice:disabled
{
color: palette(base);
border-color: palette(dark);
background-color: rgba(0,0,0,0);
}
QComboBox, QLineEdit
{
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 palette(dark), stop:0.3 palette(base));
}
QComboBox::hover, QLineEdit::hover
{
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 palette(dark), stop:0.3 palette(mid));
}
QSpinBox, QDoubleSpinBox
{
background-color: palette(base);
}
QSpinBox::hover, QDoubleSpinBox::hover
{
background-color: palette(mid);
}
QCheckBox::indicator, QTreeView::indicator
{
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 palette(dark), stop:0.3 palette(base));
border-radius: 3px;
width: 20px;
height: 20px;
}
QCheckBox::indicator::hover
{
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 palette(dark), stop:0.3 palette(mid));
}
QCheckBox::indicator:checked, QTreeView::indicator:checked
{
image: url(D:/Development/ExRealis/ExRealisGUI-build/Release/themes/QCheckBox.png);
}
QRadioButton
{
height: 23px;
}
QRadioButton::indicator
{
background-color: qradialgradient(cx:0.75, cy:1, radius:1, fx:0.5, fy:0.5 stop:0 palette(base), stop:0.85 palette(dark));
border-radius: 10px;
width: 18px;
height: 18px;
}
QRadioButton::indicator::hover
{
background-color: qradialgradient(cx:0.75, cy:1, radius:1, fx:0.5, fy:0.5 stop:0 palette(mid), stop:0.85 palette(dark));
}
QRadioButton::indicator:checked
{
image: url(D:/Development/ExRealis/ExRealisGUI-build/Release/themes/QRadioButton.png);
}
QSlider::groove:horizontal
{
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 palette(dark), stop:0.3 palette(mid));
border-radius: 10px;
height: 18px;
}
QSlider::handle:horizontal, QSlider::handle:vertical
{
image: url(D:/Development/ExRealis/ExRealisGUI-build/Release/themes/QRadioButton.png);
}
QScrollBar
{
border: 0px;
background: palette(window);
margin: 0px 0px 0px 0px;
}
QScrollBar:horizontal
{
height: 14px;
}
QScrollBar:vertical
{
width: 14px;
}
QScrollBar::handle
{
border-radius: 7px;
}
QScrollBar::handle:horizontal
{
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 palette(window), stop: 0.35 palette(light), stop: 0.75 palette(base));
min-height: 20px;
}
QScrollBar::handle:vertical
{
background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 palette(window), stop: 0.35 palette(light), stop: 0.75 palette(base));
min-width: 20px;
}
QScrollBar::add-line:horizontal, QScrollBar::sub-line:horizontal, QScrollBar::add-line:vertical, QScrollBar::sub-line:vertical
{
background:none;
}
QMenuBar
{
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 palette(dark), stop:0.3 palette(base));
}
QMenuBar::item
{
color: palette(text);
}
QMenuBar::item:selected
{
color: palette(bright-text);
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 palette(window), stop: 0.35 palette(light), stop: 0.75 palette(base));
}
QToolBar
{
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 palette(base), stop:0.3 palette(window));
border-top: 1px solid palette(shadow);
border-bottom: 1px solid palette(base);
}
QMenu
{
border: 1px solid black;
background-color: palette(base);
}
QMenu::item
{
color: palette(text);
}
QMenu::item:selected
{
color: palette(bright-text);
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 palette(window), stop: 0.35 palette(light), stop: 0.75 palette(base));
}
QToolTip
{
color: palette(text);
background-color: palette(base);
border-radius: 3px;
}
QTreeWidget
{
color: palette(text);
background-color: palette(base);
}
QHeaderView::section
{
color: palette(text);
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 palette(window), stop: 0.35 palette(light), stop: 0.75 palette(base));
}
QHeaderView::section:hover
{
color: palette(bright-text);
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 palette(window), stop: 0.35 palette(light), stop: 0.75 palette(mid));
}
QHeaderView::up-arrow, QHeaderView::down-arrow
{
image: url(D:/Development/ExRealis/ExRealisGUI-build/Release/themes/QRadioButton.png);
subcontrol-origin: margin;
subcontrol-position: right center;
}
......@@ -29,23 +29,8 @@ UIParamChoice::UIParamChoice( const QString& id,
else
{
m_Widget = new QGroupBox( name );
l->setContentsMargins( 4, 0, 4, 0 );
m_Widget->setStyleSheet(
"QGroupBox {"
"color: rgb(200,230,255);"
"border: 1px solid rgb(160,192,255);"
"border-radius: 5px;"
"margin-top: 0.5em;"
"padding: 4 2 2 2;"
"}"
"QGroupBox::title {"
"subcontrol-origin: margin;"
"left: 20px;"
"padding: 0 2 0 3;"
"font:"
"}"
);
m_Widget->setObjectName( "UIParamChoice" );
l->setContentsMargins( 4, 2, 4, 0 );
}
m_Widget->setLayout( l );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment