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

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

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

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

@ -1,15 +1,36 @@
#include <QDomDocument>
#include "core/UBApplication.h"
#include "UBLibWebView.h"
UBLibWebView::UBLibWebView(QWidget* parent, const char* name):QWidget(parent)
, mpView(NULL)
, mpWebSettings(NULL)
, mpLayout(NULL)
{
setObjectName(name);
setAttribute(Qt::WA_StyledBackground, true);
setStyleSheet(UBApplication::globalStyleSheet());
mpLayout = new QVBoxLayout();
setLayout(mpLayout);
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);
}
@ -31,6 +52,35 @@ void UBLibWebView::setElement(UBLibElement *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 <QWebView>
#include <QWebSettings>
#include <QVBoxLayout>
#include "board/UBLibraryController.h"
@ -19,6 +20,7 @@ public:
private:
QWebView* mpView;
QWebSettings* mpWebSettings;
QVBoxLayout* mpLayout;
};

Loading…
Cancel
Save