Fixed some style issues

preferencesAboutTextFull
shibakaneki 13 years ago
parent a6286cea69
commit e4d1a0c4d6
  1. 21
      resources/style.qss
  2. 2
      src/board/UBLibraryController.cpp
  3. 9
      src/gui/UBLibItemProperties.cpp
  4. 5
      src/gui/UBLibNavigatorWidget.cpp
  5. 52
      src/gui/UBLibWebView.cpp
  6. 2
      src/gui/UBLibWebView.h

@ -1,13 +1,25 @@
QWidget#DockPaletteWidgetBox, QWidget#DockPaletteWidgetBox,
QWidget#documentNavigator, QWidget#documentNavigator,
QWidget#UBLibraryWidget,
QWidget#UBLibPathViewer, QWidget#UBLibPathViewer,
QWidget#UBTeacherStudentAction QWidget#UBTeacherStudentAction,
QWidget#UBLibNavigatorWidget,
QWidget#UBLibItemProperties
{ {
background: #EEEEEE; background: #EEEEEE;
border-radius: 10px; border-radius: 10px;
border: 2px solid #999999; border: 2px solid #999999;
/* padding-bottom: -2px; */ }
QWidget#UBLibWebView
{
background: #EEEEEE;
border-radius : 10px;
border: 2px solid #999999;
}
QWebView#SearchEngineView
{
background:#EEEEEE;
} }
QColorDialog QColorDialog
@ -121,8 +133,6 @@ QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical
background:transparent; background:transparent;
} }
QScrollBar::horizontal QScrollBar::horizontal
{ {
background:transparent; background:transparent;
@ -166,7 +176,6 @@ QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal
background:transparent; background:transparent;
} }
QSlider::handle::horizontal QSlider::handle::horizontal
{ {
background-color:#EEEEEE; background-color:#EEEEEE;

@ -789,7 +789,7 @@ UBChainedLibElement* UBChainedLibElement::lastElement()
QUrl UBChainedLibElement::lastItemPath() QUrl UBChainedLibElement::lastItemPath()
{ {
lastElement()->element()->path(); return lastElement()->element()->path();
} }
UBLibElement* UBLibElement::trashElement() UBLibElement* UBLibElement::trashElement()

@ -41,6 +41,9 @@ UBLibItemProperties::UBLibItemProperties(QWidget *parent, const char *name):QWid
{ {
setObjectName(name); setObjectName(name);
setAttribute(Qt::WA_StyledBackground, true);
setStyleSheet(UBApplication::globalStyleSheet());
// Create the GUI // Create the GUI
mpLayout = new QVBoxLayout(this); mpLayout = new QVBoxLayout(this);
setLayout(mpLayout); setLayout(mpLayout);
@ -52,7 +55,8 @@ UBLibItemProperties::UBLibItemProperties(QWidget *parent, const char *name):QWid
icon.scaledToWidth(THUMBNAIL_WIDTH); icon.scaledToWidth(THUMBNAIL_WIDTH);
mpThumbnail->setPixmap(icon); mpThumbnail->setPixmap(icon);
mpThumbnail->setStyleSheet(QString("background-color : white; padding : 10 px; border-radius : 10px;")); mpThumbnail->setObjectName("DockPaletteWidgetBox");
mpThumbnail->setStyleSheet("background:white;");
mpThumbnail->setAlignment(Qt::AlignHCenter); mpThumbnail->setAlignment(Qt::AlignHCenter);
mpLayout->addWidget(mpThumbnail, 0); mpLayout->addWidget(mpThumbnail, 0);
@ -79,7 +83,8 @@ UBLibItemProperties::UBLibItemProperties(QWidget *parent, const char *name):QWid
mpObjInfos = new QTextEdit(this); mpObjInfos = new QTextEdit(this);
mpObjInfos->setReadOnly(true); mpObjInfos->setReadOnly(true);
mpObjInfos->setStyleSheet(QString("background-color: white; border-radius : 10px;")); mpObjInfos->setObjectName("DockPaletteWidgetBox");
mpObjInfos->setStyleSheet("background:white;");
mpLayout->addWidget(mpObjInfos, 1); mpLayout->addWidget(mpObjInfos, 1);
connect(mpAddPageButton, SIGNAL(clicked()), this, SLOT(onAddToPage())); connect(mpAddPageButton, SIGNAL(clicked()), this, SLOT(onAddToPage()));

@ -15,6 +15,7 @@
#include "UBLibNavigatorWidget.h" #include "UBLibNavigatorWidget.h"
#include "UBLibWidget.h" #include "UBLibWidget.h"
#include "core/UBApplication.h"
#include "core/memcheck.h" #include "core/memcheck.h"
static int lowBoundForSlider = 40; static int lowBoundForSlider = 40;
@ -33,6 +34,10 @@ UBLibNavigatorWidget::UBLibNavigatorWidget(QWidget *parent, const char *name):QW
, mSliderWidthSetting(NULL) , mSliderWidthSetting(NULL)
{ {
setObjectName(name); setObjectName(name);
setAttribute(Qt::WA_StyledBackground, true);
setStyleSheet(UBApplication::globalStyleSheet());
setAcceptDrops(true); setAcceptDrops(true);
UBLibWidget* libWidget = dynamic_cast<UBLibWidget*>(parentWidget()); UBLibWidget* libWidget = dynamic_cast<UBLibWidget*>(parentWidget());

@ -1,15 +1,36 @@
#include <QDomDocument>
#include "core/UBApplication.h"
#include "UBLibWebView.h" #include "UBLibWebView.h"
UBLibWebView::UBLibWebView(QWidget* parent, const char* name):QWidget(parent) UBLibWebView::UBLibWebView(QWidget* parent, const char* name):QWidget(parent)
, mpView(NULL) , mpView(NULL)
, mpWebSettings(NULL)
, mpLayout(NULL) , mpLayout(NULL)
{ {
setObjectName(name); setObjectName(name);
setAttribute(Qt::WA_StyledBackground, true);
setStyleSheet(UBApplication::globalStyleSheet());
mpLayout = new QVBoxLayout(); mpLayout = new QVBoxLayout();
setLayout(mpLayout); setLayout(mpLayout);
mpView = new QWebView(this); mpView = new QWebView(this);
mpView->setObjectName("SearchEngineView");
//mpView->setStyleSheet(QString("background-color:white;"));
mpWebSettings = QWebSettings::globalSettings();
mpWebSettings->setAttribute(QWebSettings::JavaEnabled, true);
mpWebSettings->setAttribute(QWebSettings::PluginsEnabled, true);
mpWebSettings->setAttribute(QWebSettings::JavaEnabled, true);
mpWebSettings->setAttribute(QWebSettings::LocalStorageDatabaseEnabled, true);
mpWebSettings->setAttribute(QWebSettings::OfflineWebApplicationCacheEnabled, true);
mpWebSettings->setAttribute(QWebSettings::OfflineStorageDatabaseEnabled, true);
mpWebSettings->setAttribute(QWebSettings::JavascriptCanAccessClipboard, true);
mpWebSettings->setAttribute(QWebSettings::DnsPrefetchEnabled, true);
mpLayout->addWidget(mpView); mpLayout->addWidget(mpView);
} }
@ -31,6 +52,35 @@ void UBLibWebView::setElement(UBLibElement *elem)
{ {
if(NULL != elem) if(NULL != elem)
{ {
mpView->load(elem->path()); QString qsWidgetName;
QString path = elem->path().toLocalFile();
QString qsConfigPath = QString("%0/config.xml").arg(path);
if(QFile::exists(qsConfigPath))
{
QFile f(qsConfigPath);
if(f.open(QIODevice::ReadOnly))
{
QDomDocument domDoc;
domDoc.setContent(QString(f.readAll()));
QDomElement root = domDoc.documentElement();
QDomNode node = root.firstChild();
while(!node.isNull())
{
if(node.toElement().tagName() == "content")
{
QDomAttr srcAttr = node.toElement().attributeNode("src");
qsWidgetName = srcAttr.value();
break;
}
node = node.nextSibling();
}
f.close();
}
}
mpView->load(QUrl::fromLocalFile(QString("%0/%1").arg(path).arg(qsWidgetName)));
} }
} }

@ -3,6 +3,7 @@
#include <QWidget> #include <QWidget>
#include <QWebView> #include <QWebView>
#include <QWebSettings>
#include <QVBoxLayout> #include <QVBoxLayout>
#include "board/UBLibraryController.h" #include "board/UBLibraryController.h"
@ -19,6 +20,7 @@ public:
private: private:
QWebView* mpView; QWebView* mpView;
QWebSettings* mpWebSettings;
QVBoxLayout* mpLayout; QVBoxLayout* mpLayout;
}; };

Loading…
Cancel
Save