Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
flatpak-qt-creator
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
a6a04985
Commit
a6a04985
authored
Mar 09, 2010
by
Lasse Holmstedt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Editor toolbar integration
parent
9534f6bc
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
265 additions
and
310 deletions
+265
-310
src/plugins/coreplugin/coreplugin.pro
src/plugins/coreplugin/coreplugin.pro
+1
-1
src/plugins/coreplugin/designmodetoolbar.cpp
src/plugins/coreplugin/designmodetoolbar.cpp
+181
-67
src/plugins/coreplugin/designmodetoolbar.h
src/plugins/coreplugin/designmodetoolbar.h
+45
-8
src/plugins/coreplugin/editormanager/editormanager.cpp
src/plugins/coreplugin/editormanager/editormanager.cpp
+2
-2
src/plugins/coreplugin/editormanager/editormanager.h
src/plugins/coreplugin/editormanager/editormanager.h
+3
-2
src/plugins/coreplugin/editormanager/editorview.cpp
src/plugins/coreplugin/editormanager/editorview.cpp
+22
-199
src/plugins/coreplugin/editormanager/editorview.h
src/plugins/coreplugin/editormanager/editorview.h
+5
-19
src/plugins/qmldesigner/designmodewidget.cpp
src/plugins/qmldesigner/designmodewidget.cpp
+4
-9
src/plugins/qmldesigner/designmodewidget.h
src/plugins/qmldesigner/designmodewidget.h
+2
-3
No files found.
src/plugins/coreplugin/coreplugin.pro
View file @
a6a04985
...
...
@@ -82,7 +82,7 @@ SOURCES += mainwindow.cpp \
imode
.
cpp
\
editormanager
/
systemeditor
.
cpp
\
designmode
.
cpp
\
fak
etoolbar
.
cpp
designmod
etoolbar
.
cpp
HEADERS
+=
mainwindow
.
h
\
editmode
.
h
\
...
...
src/plugins/coreplugin/designmodetoolbar.cpp
View file @
a6a04985
This diff is collapsed.
Click to expand it.
src/plugins/coreplugin/designmodetoolbar.h
View file @
a6a04985
...
...
@@ -34,6 +34,8 @@
#include <QWidget>
#include <QtCore/QPointer>
#include <utils/styledbar.h>
QT_BEGIN_NAMESPACE
class
QComboBox
;
class
QToolButton
;
...
...
@@ -49,28 +51,56 @@ namespace Core {
* Fakes an IEditor-like toolbar for design mode widgets such as Qt Designer and Bauhaus.
* Creates a combobox for open files and lock and close buttons on the right.
*/
class
CORE_EXPORT
DesignModeToolBar
:
public
QWidget
class
CORE_EXPORT
EditorToolBar
:
public
Utils
::
StyledBar
{
Q_OBJECT
Q_DISABLE_COPY
(
Fake
ToolBar
)
Q_DISABLE_COPY
(
Editor
ToolBar
)
public:
explicit
DesignModeToolBar
(
QWidget
*
parent
=
0
);
void
setEditor
(
Core
::
IEditor
*
editor
);
void
setCenterToolBar
(
QWidget
*
toolBar
);
explicit
EditorToolBar
(
QWidget
*
parent
=
0
);
enum
ToolbarCreationFlags
{
FlagsNone
=
0
,
FlagsIgnoreIEditorToolBar
=
1
};
/**
* Adds an editor to listen to state changes so that the editor can be updated accordingly.
*/
void
addEditor
(
IEditor
*
editor
,
ToolbarCreationFlags
flags
=
FlagsNone
);
/**
* Sets the editor and adds its custom toolbar to the widget.
*/
void
setCurrentEditor
(
IEditor
*
editor
);
/**
* Adds a toolbar to the widget and sets invisible by default.
*/
void
addCenterToolBar
(
QWidget
*
toolBar
);
void
updateActions
();
void
setNavigationVisible
(
bool
isVisible
);
void
setCanGoBack
(
bool
canGoBack
);
void
setCanGoForward
(
bool
canGoForward
);
void
removeToolbarForEditor
(
IEditor
*
editor
);
public
slots
:
void
updateEditorStatus
(
IEditor
*
editor
);
signals:
void
closeClicked
();
void
goBackClicked
();
void
goForwardClicked
();
private
slots
:
void
updateEditorListSelection
(
Core
::
IEditor
*
newSelection
);
void
listSelectionActivated
(
int
row
);
void
listContextMenu
(
QPoint
);
void
makeEditorWritable
();
void
updateEditorStatus
();
void
checkEditorStatus
();
void
closeView
();
void
updateActionShortcuts
();
private:
void
updateToolBar
(
QWidget
*
toolBar
);
IEditor
*
currentEditor
()
const
;
Core
::
OpenEditorsModel
*
m_editorsListModel
;
QComboBox
*
m_editorList
;
QToolBar
*
m_centerToolBar
;
...
...
@@ -79,7 +109,14 @@ private:
QToolButton
*
m_lockButton
;
QAction
*
m_goBackAction
;
QAction
*
m_goForwardAction
;
QPointer
<
Core
::
IEditor
>
m_editor
;
QToolButton
*
m_backButton
;
QToolButton
*
m_forwardButton
;
QWidget
*
m_activeToolBar
;
QWidget
*
m_toolBarPlaceholder
;
QWidget
*
m_defaultToolBar
;
bool
m_ignoreEditorToolbar
;
};
}
...
...
src/plugins/coreplugin/editormanager/editormanager.cpp
View file @
a6a04985
...
...
@@ -443,9 +443,9 @@ void EditorManager::init()
}
DesignModeToolBar
*
EditorManager
::
createFak
eToolBar
(
QWidget
*
parent
)
EditorToolBar
*
EditorManager
::
creat
eToolBar
(
QWidget
*
parent
)
{
return
new
DesignMode
ToolBar
(
parent
);
return
new
Editor
ToolBar
(
parent
);
}
QString
EditorManager
::
defaultExternalEditor
()
const
...
...
src/plugins/coreplugin/editormanager/editormanager.h
View file @
a6a04985
...
...
@@ -57,7 +57,7 @@ class IFile;
class
IMode
;
class
IVersionControl
;
class
DesignMode
ToolBar
;
class
Editor
ToolBar
;
enum
MakeWritableResult
{
OpenedWithVersionControl
,
...
...
@@ -107,7 +107,7 @@ public:
void
init
();
static
EditorManager
*
instance
()
{
return
m_instance
;
}
static
DesignModeToolBar
*
createFak
eToolBar
(
QWidget
*
parent
=
0
);
static
EditorToolBar
*
creat
eToolBar
(
QWidget
*
parent
=
0
);
enum
OpenEditorFlag
{
NoActivate
=
1
,
...
...
@@ -265,6 +265,7 @@ private:
friend
class
Core
::
Internal
::
SplitterOrView
;
friend
class
Core
::
Internal
::
EditorView
;
friend
class
Core
::
EditorToolBar
;
};
}
// namespace Core
...
...
src/plugins/coreplugin/editormanager/editorview.cpp
View file @
a6a04985
This diff is collapsed.
Click to expand it.
src/plugins/coreplugin/editormanager/editorview.h
View file @
a6a04985
...
...
@@ -56,6 +56,7 @@ namespace Core {
class
IEditor
;
class
OpenEditorsModel
;
class
EditorToolBar
;
namespace
Internal
{
...
...
@@ -71,7 +72,7 @@ class EditorView : public QWidget
Q_OBJECT
public:
EditorView
(
OpenEditorsModel
*
model
=
0
,
QWidget
*
parent
=
0
);
EditorView
(
QWidget
*
parent
=
0
);
virtual
~
EditorView
();
int
editorCount
()
const
;
...
...
@@ -95,28 +96,17 @@ public:
QObject
*
object
,
const
char
*
member
);
void
hideEditorStatusBar
(
const
QString
&
id
);
public
slots
:
void
closeView
();
private
slots
:
void
updateEditorStatus
(
Core
::
IEditor
*
editor
=
0
);
void
checkEditorStatus
();
void
makeEditorWritable
();
void
listSelectionActivated
(
int
index
);
void
listContextMenu
(
QPoint
);
private:
void
updateNavigatorActions
();
void
updateToolBar
(
IEditor
*
editor
);
void
checkProjectLoaded
(
IEditor
*
editor
);
OpenEditorsModel
*
m_model
;
QWidget
*
m_toolBar
;
QWidget
*
m_activeToolBar
;
EditorToolBar
*
m_toolBar
;
QStackedWidget
*
m_container
;
QComboBox
*
m_editorList
;
QToolButton
*
m_closeButton
;
QToolButton
*
m_lockButton
;
QWidget
*
m_defaultToolBar
;
QString
m_infoWidgetId
;
QFrame
*
m_infoWidget
;
QLabel
*
m_infoWidgetLabel
;
...
...
@@ -134,9 +124,6 @@ private:
QList
<
EditLocation
>
m_editorHistory
;
int
m_currentNavigationHistoryPosition
;
void
updateCurrentPositionInNavigationHistory
();
QAction
*
m_goBackAction
;
QAction
*
m_goForwardAction
;
void
updateActions
();
public:
...
...
@@ -146,7 +133,6 @@ public:
public
slots
:
void
goBackInNavigationHistory
();
void
goForwardInNavigationHistory
();
void
updateActionShortcuts
();
public:
void
addCurrentPositionToNavigationHistory
(
IEditor
*
editor
=
0
,
const
QByteArray
&
saveState
=
QByteArray
());
...
...
src/plugins/qmldesigner/designmodewidget.cpp
View file @
a6a04985
...
...
@@ -122,7 +122,7 @@ DocumentWidget::DocumentWidget(TextEditor::ITextEditor *textEditor, QPlainTextEd
m_leftSideBar
(
0
),
m_rightSideBar
(
0
),
m_designToolBar
(
new
QToolBar
),
m_fakeToolBar
(
Core
::
EditorManager
::
create
Fake
ToolBar
(
this
)),
m_fakeToolBar
(
Core
::
EditorManager
::
createToolBar
(
this
)),
m_isDisabled
(
false
),
m_warningWidget
(
0
)
{
...
...
@@ -203,11 +203,6 @@ void DocumentWidget::setAutoSynchronization(bool sync)
}
}
void
DocumentWidget
::
closeEditor
()
{
Core
::
ICore
::
instance
()
->
editorManager
()
->
closeEditors
(
QList
<
IEditor
*>
()
<<
textEditor
());
}
void
DocumentWidget
::
enable
()
{
if
(
debug
)
...
...
@@ -302,9 +297,9 @@ void DocumentWidget::setup()
m_designToolBar
->
setSizePolicy
(
QSizePolicy
::
Expanding
,
QSizePolicy
::
Ignored
);
connect
(
m_fakeToolBar
,
SIGNAL
(
closeClicked
()),
this
,
SLOT
(
closeEditor
())
);
m_fakeToolBar
->
setEditor
(
textEditor
()
);
m_fakeToolBar
->
set
CenterToolBar
(
m_designToolBar
);
m_fakeToolBar
->
addEditor
(
textEditor
(),
Core
::
EditorToolBar
::
FlagsIgnoreIEditorToolBar
);
m_fakeToolBar
->
addCenterToolBar
(
m_designToolBar
);
m_fakeToolBar
->
set
NavigationVisible
(
false
);
// right area:
QWidget
*
centerWidget
=
new
QWidget
;
...
...
src/plugins/qmldesigner/designmodewidget.h
View file @
a6a04985
...
...
@@ -62,7 +62,7 @@ QT_END_NAMESPACE
namespace
Core
{
class
SideBar
;
class
OpenEditorsModel
;
class
DesignMode
ToolBar
;
class
Editor
ToolBar
;
}
namespace
QmlDesigner
{
...
...
@@ -115,7 +115,6 @@ private slots:
void
enable
();
void
disable
(
const
QList
<
RewriterView
::
Error
>
&
errors
);
void
updateErrorStatus
(
const
QList
<
RewriterView
::
Error
>
&
errors
);
void
closeEditor
();
private:
void
setup
();
...
...
@@ -131,7 +130,7 @@ private:
Core
::
SideBar
*
m_rightSideBar
;
QToolBar
*
m_designToolBar
;
Core
::
DesignMode
ToolBar
*
m_fakeToolBar
;
Core
::
Editor
ToolBar
*
m_fakeToolBar
;
bool
m_isDisabled
;
DocumentWarningWidget
*
m_warningWidget
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment