Skip to content
This repository has been archived by the owner on Aug 7, 2022. It is now read-only.

Commit

Permalink
expander disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
nitramr committed Oct 23, 2016
1 parent c51c1ad commit 5b112b6
Show file tree
Hide file tree
Showing 9 changed files with 90 additions and 68 deletions.
63 changes: 26 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,56 +20,45 @@ For Bugs and patches: please send them to the [Scribus Bugtracker](http://bugs.s
|IRC | irc://scribus@chat.freenode.net |


## IndigoDock integration
## Source Code Compiling (Linux)

Following files has been updated to integrate the IndigoDock
The best way to compile Scribus is via Cmake.

ui/scdockpalette.h
ui/scdockpalette.cpp
- change type to IndigoPanel
If Cmake is not installed on your system open terminal and type in following command and press enter (you have to input your admin password afterwards):

```C++
ScDockPalette::ScDockPalette( QWidget * parent, const QString& prefsContext, Qt::WindowFlags f)

: IndigoPanel(prefsContext ),

palettePrefs(0),
prefsContextName(QString::null),
visibleOnStartup(false)
{
...
sudo apt-get install cmake
```

scribus.h
scribus.cpp
- add function initIndigoDock()
- add Panels to Indigodock in initPalettes()
If Cmake is already installed do following steps.
1. Download Scribus-Indigo to your local system or clone the git repository
2. Create a new folder "Scribus" on your desktop
3. Unzip the downloaded project into your Scribus folder on desktop (Desktop/Scribus/scribus-indigo-master)
4. Create a new folder "bin" in your Scribus folder on desktop (Desktop/Scribus/bin)
5. Open terminal and enter following commands to compile the source code:


```C++
void ScribusMainWindow::initIndigoDock()
{
cd ~/Desktop/Scribus/bin
cmake --debug-output ../scribus-indigo-master
make -j4
```

After compiling was successfully you have to install the compiled file and necessary resources. Enter following command:

// install IndigoDockManager
wdg_indigoDockManager = new IndigoDockManager(this);
wdg_indigoDockManager->setMinimumPanelSize(QSize(180,100));

wdg_indigoDock = new IndigoDock();
```C++
sudo make install
```

You can find Scribus in following location:
./user/local/bin/

// Add IndigoDock
wdg_indigoDockManager->addIndigoDock(wdg_indigoDock, Qt::RightDockWidgetArea );

}
```
For uninstalling use following commands:
```C++
void ScribusMainWindow::initPalettes()
{
cd ~/Desktop/Scribus/bin
sudo make uninstall
```


//CB TODO hide the publicly available members of some palettes
// these must be filtered too as they take control of the palettes events
outlinePalette = new OutlinePalette(this);
outlinePalette->setMainWindow(this);
wdg_indigoDockManager->addIndigoPanel(wdg_indigoDock, outlinePalette);
...
```
2 changes: 1 addition & 1 deletion Scribus.pro.user
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 3.6.1, 2016-10-16T02:20:59. -->
<!-- Written by QtCreator 3.6.1, 2016-10-17T00:10:13. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
Expand Down
36 changes: 18 additions & 18 deletions scribus/scribus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -651,30 +651,30 @@ void ScribusMainWindow::initPalettes()
// Properties
propertiesPalette = new PropertiesPalette(this);
propertiesPalette->setMainWindow(this);
wdg_indigoDockManager->addIndigoPanel(wdg_indigoDock, propertiesPalette, IndigoPanel::Docked, true);
wdg_indigoDockManager->addIndigoPanel(wdg_indigoDock, propertiesPalette);
connect( scrActions["toolsProperties"], SIGNAL(toggled(bool)) , propertiesPalette, SLOT(setPaletteShown(bool)) );
connect( propertiesPalette, SIGNAL(paletteShown(bool)), scrActions["toolsProperties"], SLOT(setChecked(bool)));
emit UpdateRequest(reqDefFontListUpdate);
propertiesPalette->installEventFilter(this);

// Aligment
alignDistributePalette = new AlignDistributePalette(this, "AlignDistributePalette");
wdg_indigoDockManager->addIndigoPanel(wdg_indigoDock, alignDistributePalette, IndigoPanel::Docked, true);
wdg_indigoDockManager->addIndigoPanel(wdg_indigoDock, alignDistributePalette);
connect( scrActions["toolsAlignDistribute"], SIGNAL(toggled(bool)) , alignDistributePalette, SLOT(setPaletteShown(bool)) );
connect( alignDistributePalette, SIGNAL(paletteShown(bool)), scrActions["toolsAlignDistribute"], SLOT(setChecked(bool)));
connect( alignDistributePalette, SIGNAL(documentChanged()), this, SLOT(slotDocCh()));
alignDistributePalette->installEventFilter(this);

// Pages
pagePalette = new PagePalette(this);
wdg_indigoDockManager->addIndigoPanel(wdg_indigoDock, pagePalette, IndigoPanel::Docked, true);
wdg_indigoDockManager->addIndigoPanel(wdg_indigoDock, pagePalette);
connect( scrActions["toolsPages"], SIGNAL(toggled(bool)) , pagePalette, SLOT(setPaletteShown(bool)) );
connect( pagePalette, SIGNAL(paletteShown(bool)), scrActions["toolsPages"], SLOT(setChecked(bool)));
pagePalette->installEventFilter(this);

// Layers
layerPalette = new LayerPalette(this);
wdg_indigoDockManager->addIndigoPanel(wdg_indigoDock, layerPalette, IndigoPanel::Docked, true);
wdg_indigoDockManager->addIndigoPanel(wdg_indigoDock, layerPalette);
connect( scrActions["toolsLayers"], SIGNAL(toggled(bool)) , layerPalette, SLOT(setPaletteShown(bool)) );
connect( layerPalette, SIGNAL(paletteShown(bool)), scrActions["toolsLayers"], SLOT(setChecked(bool)));
layerPalette->installEventFilter(this);
Expand All @@ -684,7 +684,7 @@ void ScribusMainWindow::initPalettes()
// Outline
outlinePalette = new OutlinePalette(this);
outlinePalette->setMainWindow(this);
wdg_indigoDockManager->addIndigoPanel(wdg_indigoDock, outlinePalette, IndigoPanel::HiddenDocked, true);
wdg_indigoDockManager->addIndigoPanel(wdg_indigoDock, outlinePalette);
connect( scrActions["toolsOutline"], SIGNAL(toggled(bool)) , outlinePalette, SLOT(setPaletteShown(bool)) );
connect( outlinePalette, SIGNAL(paletteShown(bool)), scrActions["toolsOutline"], SLOT(setChecked(bool)));
connect(outlinePalette, SIGNAL(selectElementByItem(PageItem *, bool)), this, SLOT(selectItemsFromOutlines(PageItem *, bool)));
Expand All @@ -695,7 +695,7 @@ void ScribusMainWindow::initPalettes()
// Inline
inlinePalette = new InlinePalette(this);
inlinePalette->setMainWindow(this);
wdg_indigoDockManager->addIndigoPanel(wdg_indigoDock, inlinePalette, IndigoPanel::HiddenDocked, true);
wdg_indigoDockManager->addIndigoPanel(wdg_indigoDock, inlinePalette);
connect(scrActions["toolsInline"], SIGNAL(toggled(bool)), inlinePalette, SLOT(setPaletteShown(bool)));
connect(inlinePalette, SIGNAL(paletteShown(bool)), scrActions["toolsInline"], SLOT(setChecked(bool)));
connect(inlinePalette, SIGNAL(startEdit(int)), this, SLOT(editInlineStart(int)));
Expand All @@ -705,7 +705,7 @@ void ScribusMainWindow::initPalettes()

// Bookmarks
bookmarkPalette = new BookPalette(this);
wdg_indigoDockManager->addIndigoPanel(wdg_indigoDock, bookmarkPalette, IndigoPanel::HiddenDocked, true);
wdg_indigoDockManager->addIndigoPanel(wdg_indigoDock, bookmarkPalette);
connect( scrActions["toolsBookmarks"], SIGNAL(toggled(bool)) , bookmarkPalette, SLOT(setPaletteShown(bool)) );
connect( bookmarkPalette, SIGNAL(paletteShown(bool)), scrActions["toolsBookmarks"], SLOT(setChecked(bool)));
bookmarkPalette->installEventFilter(this);
Expand All @@ -716,7 +716,7 @@ void ScribusMainWindow::initPalettes()
// Symbol
symbolPalette = new SymbolPalette(this);
symbolPalette->setMainWindow(this);
wdg_indigoDockManager->addIndigoPanel(wdg_indigoDock, symbolPalette, IndigoPanel::HiddenDocked, true);
wdg_indigoDockManager->addIndigoPanel(wdg_indigoDock, symbolPalette);
connect(scrActions["toolsSymbols"], SIGNAL(toggled(bool)), symbolPalette, SLOT(setPaletteShown(bool)));
connect(symbolPalette, SIGNAL(paletteShown(bool)), scrActions["toolsSymbols"], SLOT(setChecked(bool)));
connect(symbolPalette, SIGNAL(startEdit(QString)), this, SLOT(editSymbolStart(QString)));
Expand All @@ -726,13 +726,21 @@ void ScribusMainWindow::initPalettes()

// Scapebook
scrapbookPalette = new Biblio(this);
wdg_indigoDockManager->addIndigoPanel(wdg_indigoDock, scrapbookPalette, IndigoPanel::HiddenDocked, true);
wdg_indigoDockManager->addIndigoPanel(wdg_indigoDock, scrapbookPalette);
connect( scrActions["toolsScrapbook"], SIGNAL(toggled(bool)) , scrapbookPalette, SLOT(setPaletteShown(bool)) );
connect( scrapbookPalette, SIGNAL(paletteShown(bool)), scrActions["toolsScrapbook"], SLOT(setChecked(bool)));
connect( scrapbookPalette, SIGNAL(pasteToActualPage(QString)), this, SLOT(pasteFromScrapbook(QString)));
connect( scrapbookPalette, SIGNAL(scrapbookListChanged()), this, SLOT(rebuildScrapbookMenu()));
scrapbookPalette->installEventFilter(this);

// Undo
undoPalette = new UndoPalette(this, "undoPalette");
wdg_indigoDockManager->addIndigoPanel(wdg_indigoDock, undoPalette);
undoPalette->installEventFilter(this);
m_undoManager->registerGui(undoPalette);
connect(undoPalette, SIGNAL(paletteShown(bool)), this, SLOT(setUndoPalette(bool)));
connect(undoPalette, SIGNAL(objectMode(bool)), this, SLOT(setUndoMode(bool)));

// Node
nodePalette = new NodePalette(this);
nodePalette->installEventFilter(this);
Expand Down Expand Up @@ -769,15 +777,7 @@ void ScribusMainWindow::initPalettes()
connect(docCheckerPalette, SIGNAL(selectPage(int)), this, SLOT(selectPagesFromOutlines(int)));
connect(docCheckerPalette, SIGNAL(selectMasterPage(QString)), this, SLOT(editMasterPagesStart(QString)));

// Undo
undoPalette = new UndoPalette(this, "undoPalette");
wdg_indigoDockManager->addIndigoPanel(wdg_indigoDock, undoPalette, IndigoPanel::HiddenDocked, true);
undoPalette->installEventFilter(this);
m_undoManager->registerGui(undoPalette);
connect(undoPalette, SIGNAL(paletteShown(bool)), this, SLOT(setUndoPalette(bool)));
connect(undoPalette, SIGNAL(objectMode(bool)), this, SLOT(setUndoMode(bool)));

// initializing style manager here too even it's not strictly a palette
// initializing style manager here too even it's not strictly a palette
m_styleManager = new StyleManager(this, "styleManager");
SMCharacterStyle *tmpCS = new SMCharacterStyle();
m_styleManager->addStyle(new SMParagraphStyle(tmpCS));
Expand Down
2 changes: 1 addition & 1 deletion scribus/ui/aligndistribute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ AlignDistributePalette::AlignDistributePalette( QWidget* parent, const char* nam
//setSizePolicy( QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum));
currDoc=NULL;
guideDirection=-1;
setObjectName(name);
setObjectName(name);

//hide spare controls
toolButtonDummy1->hide();
Expand Down
2 changes: 1 addition & 1 deletion scribus/ui/indigodock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ void IndigoDock::updateMinHeight(){
// reset size limit
setMaximumSize(QSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX));

update();
update();
}
}

Expand Down
2 changes: 1 addition & 1 deletion scribus/ui/indigodockmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ void IndigoDockManager::setPrefsContext(QString context)
prefsContextName=context;
if (!prefsContextName.isEmpty())
{
palettePrefs = PrefsManager::instance()->prefsFile->getContext(prefsContextName);
palettePrefs = PrefsManager::instance()->prefsFile->getContext(prefsContextName);
}
else{
palettePrefs = NULL;
Expand Down
31 changes: 27 additions & 4 deletions scribus/ui/indigopanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ IndigoPanelHandle::IndigoPanelHandle(QWidget *parent) :

setLayout(mainLayout);
setObjectName("IndigoPanelHandle");
enableExpander(false);

// Actions
connect(wdg_btnClose, SIGNAL (clicked()), parent, SLOT (hide()));
Expand Down Expand Up @@ -179,6 +180,17 @@ void IndigoPanelHandle::setExpanderState(IndigoExpanderState expanderState){
}



void IndigoPanelHandle::enableExpander(bool visible){
bool_showExpander = visible;

if(bool_showExpander){
wdg_btnExpander->show();
}else wdg_btnExpander->hide();

}


/*#####################
#
#
Expand All @@ -192,7 +204,8 @@ IndigoPanel::IndigoPanel(QString name, QWidget *dock) :
QFrame(dock),
palettePrefs(0),
prefsContextName(QString::null),
bool_visibleOnStartup(false)
bool_visibleOnStartup(false),
bool_showExpander(false)
{
int int_padding = 5;

Expand Down Expand Up @@ -242,7 +255,7 @@ IndigoPanel::IndigoPanel(QString name, QWidget *dock) :

// Extended Properties
int_index = -1;
m_state = IndigoPanel::None;
m_state = IndigoPanel::Docked;
m_expander = IndigoPanelHandle::Normal;

// General Properties
Expand All @@ -256,6 +269,7 @@ IndigoPanel::IndigoPanel(QString name, QWidget *dock) :
setObjectName(name);
setIcon(icon, 0);
setHandleWidth(int_handleWidth);
enableExpander(bool_showExpander);

setPrefsContext(name);
}
Expand Down Expand Up @@ -851,7 +865,7 @@ void IndigoPanel::setDockState(IndigoPanel::IndigoDockState state){

switch(state){
case IndigoPanel::HiddenDocked:
QFrame::hide();
QFrame::hide();
break;

case IndigoPanel::Floating:
Expand All @@ -863,7 +877,7 @@ void IndigoPanel::setDockState(IndigoPanel::IndigoDockState state){
case IndigoPanel::Docked:
case IndigoPanel::None:
default:
QFrame::show();
QFrame::show();
break;
}

Expand Down Expand Up @@ -977,3 +991,12 @@ int IndigoPanel::dockWidth(){

return int_dockWidth;
}



void IndigoPanel::enableExpander(bool visible)
{
bool_showExpander = visible;
wdg_handle->enableExpander(visible);

}
14 changes: 9 additions & 5 deletions scribus/ui/indigopanel.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class IndigoPanelHandle : public QWidget
void setCaption(QString title, int fontSize);
void setIcon(QIcon icon, int iconSize);
void setExpanderState(IndigoExpanderState expanderState);
void enableExpander(bool visible);

protected:
void paintEvent(QPaintEvent *event);
Expand All @@ -71,6 +72,7 @@ class IndigoPanelHandle : public QWidget
int int_fontSize;
QToolButton * wdg_btnClose;
QToolButton * wdg_btnExpander;
bool bool_showExpander;


signals:
Expand All @@ -88,12 +90,12 @@ class IndigoPanel : public QFrame
public:
enum IndigoDockState{

HiddenDocked = 0,
Floating = 1,
Docked = 2,
None = 3
HiddenDocked = 0,
Floating = 1,
Docked = 2,
None = 3

};
};



Expand Down Expand Up @@ -124,6 +126,7 @@ class IndigoPanel : public QFrame
IndigoPanelHandle::IndigoExpanderState expanderState();
void setExpanderState(IndigoPanelHandle::IndigoExpanderState expanderState);
void setExpanderState(int expanderState);
void enableExpander(bool visible);

void setOrientation(Qt::Orientation orientation);
void setHandleWidth(int width);
Expand Down Expand Up @@ -175,6 +178,7 @@ class IndigoPanel : public QFrame
int int_index;
IndigoDockState m_state;
IndigoPanelHandle::IndigoExpanderState m_expander;
bool bool_showExpander;

Qt::Orientation m_orientation;
int int_handleWidth;
Expand Down
6 changes: 6 additions & 0 deletions scribus/ui/indigotabbar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,8 @@ void IndigoTabBar::insertTab(QIcon icon, int index, QString toolTip){

void IndigoTabBar::removeTab(int index){

if(lst_TabList.size() == 0) return;

if(index >= 0 && index <= lst_TabList.size()){
lst_TabList.removeAt(index);

Expand Down Expand Up @@ -255,6 +257,8 @@ void IndigoTabBar::moveTab(){

void IndigoTabBar::hideTab(int index){

if(lst_TabList.size() == 0) return;

if(index >= 0 && index <= lst_TabList.size()){
lst_TabList.at(index)->setDisplayState(IndigoTab::Hidden);
calculateSize();
Expand All @@ -266,6 +270,8 @@ void IndigoTabBar::hideTab(int index){

void IndigoTabBar::showTab(int index){

if(lst_TabList.size() == 0) return;

if(index >= 0 && index <= lst_TabList.size()){
lst_TabList.at(index)->setDisplayState(IndigoTab::Visible);
calculateSize();
Expand Down

0 comments on commit 5b112b6

Please sign in to comment.