Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
bcbabc4b
Kaydet (Commit)
bcbabc4b
authored
Eyl 21, 2011
tarafından
Dmitry Ashkadov
Kaydeden (comit)
Caolán McNamara
Eyl 21, 2011
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
fdo#39430: Implement improved Saving Information Icon in the Status Bar
üst
1b296583
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
89 additions
and
26 deletions
+89
-26
doc_modified_feedback.png
default_images/svx/res/doc_modified_feedback.png
+0
-0
doc_modified_no_14.png
default_images/svx/res/doc_modified_no_14.png
+0
-0
doc_modified_yes_14.png
default_images/svx/res/doc_modified_yes_14.png
+0
-0
dialogs.hrc
svx/inc/svx/dialogs.hrc
+5
-4
modctrl.hxx
svx/inc/svx/modctrl.hxx
+10
-0
modctrl.cxx
svx/source/stbctrls/modctrl.cxx
+66
-22
stbctrls.src
svx/source/stbctrls/stbctrls.src
+8
-0
No files found.
default_images/svx/res/doc_modified_feedback.png
0 → 100644
Dosyayı görüntüle @
bcbabc4b
462 Bytes
default_images/svx/res/doc_modified_no_14.png
Değiştirilen dosyayı @ görüntüle
1b296583
Dosyayı görüntüle @
bcbabc4b
429 Bytes
|
W:
|
H:
369 Bytes
|
W:
|
H:
2-up
Swipe
Onion skin
default_images/svx/res/doc_modified_yes_14.png
Değiştirilen dosyayı @ görüntüle
1b296583
Dosyayı görüntüle @
bcbabc4b
506 Bytes
|
W:
|
H:
462 Bytes
|
W:
|
H:
2-up
Swipe
Onion skin
svx/inc/svx/dialogs.hrc
Dosyayı görüntüle @
bcbabc4b
...
...
@@ -1156,9 +1156,10 @@
#define SVX_OOO_BUILD_START (RID_SVX_START + 1200)
#define RID_SVXBMP_DOC_MODIFIED_YES (SVX_OOO_BUILD_START + 1)
#define RID_SVXBMP_DOC_MODIFIED_NO (SVX_OOO_BUILD_START + 2)
#define RID_SVXSTR_DOC_MODIFIED_YES (SVX_OOO_BUILD_START + 3)
#define RID_SVXSTR_DOC_MODIFIED_NO (SVX_OOO_BUILD_START + 4)
#define RID_SVXBMP_DOC_MODIFIED_YES (SVX_OOO_BUILD_START + 1)
#define RID_SVXBMP_DOC_MODIFIED_NO (SVX_OOO_BUILD_START + 2)
#define RID_SVXBMP_DOC_MODIFIED_FEEDBACK (SVX_OOO_BUILD_START + 3)
#define RID_SVXSTR_DOC_MODIFIED_YES (SVX_OOO_BUILD_START + 4)
#define RID_SVXSTR_DOC_MODIFIED_NO (SVX_OOO_BUILD_START + 5)
#endif
svx/inc/svx/modctrl.hxx
Dosyayı görüntüle @
bcbabc4b
...
...
@@ -30,11 +30,15 @@
// include ---------------------------------------------------------------
#include <tools/link.hxx>
#include <sfx2/stbitem.hxx>
#include "svx/svxdllapi.h"
#include <boost/shared_ptr.hpp>
// Forward declarations
class
Timer
;
// class SvxModifyControl ------------------------------------------------
class
SVX_DLLPUBLIC
SvxModifyControl
:
public
SfxStatusBarControl
...
...
@@ -49,6 +53,12 @@ public:
SvxModifyControl
(
sal_uInt16
nSlotId
,
sal_uInt16
nId
,
StatusBar
&
rStb
);
private
:
// Links
DECL_LINK
(
OnTimer
,
Timer
*
);
private
:
// Functions
void
_repaint
();
private
:
struct
ImplData
;
::
boost
::
shared_ptr
<
ImplData
>
mpImpl
;
...
...
svx/source/stbctrls/modctrl.cxx
Dosyayı görüntüle @
bcbabc4b
...
...
@@ -33,6 +33,7 @@
#include <vcl/status.hxx>
#include <vcl/image.hxx>
#include <vcl/timer.hxx>
#include <svl/eitem.hxx>
#include <sfx2/app.hxx>
...
...
@@ -48,20 +49,37 @@ using ::rtl::OUString;
SFX_IMPL_STATUSBAR_CONTROL
(
SvxModifyControl
,
SfxBoolItem
);
namespace
{
const
unsigned
_FEEDBACK_TIMEOUT
=
3000
;
}
// class SvxModifyControl ------------------------------------------------
struct
SvxModifyControl
::
ImplData
{
Image
maModifiedButton
;
Image
maNonModifiedButton
;
enum
ModificationState
{
MODIFICATION_STATE_NO
=
0
,
MODIFICATION_STATE_YES
,
MODIFICATION_STATE_FEEDBACK
,
MODIFICATION_STATE_SIZE
};
Timer
maTimer
;
Image
maImages
[
MODIFICATION_STATE_SIZE
];
bool
mbModified
;
ModificationState
mnModState
;
ImplData
()
:
maModifiedButton
(
SVX_RES
(
RID_SVXBMP_DOC_MODIFIED_YES
)
),
maNonModifiedButton
(
SVX_RES
(
RID_SVXBMP_DOC_MODIFIED_NO
)
),
mbModified
(
false
)
ImplData
()
:
mnModState
(
MODIFICATION_STATE_NO
)
{
maImages
[
MODIFICATION_STATE_NO
]
=
Image
(
SVX_RES
(
RID_SVXBMP_DOC_MODIFIED_NO
));
maImages
[
MODIFICATION_STATE_YES
]
=
Image
(
SVX_RES
(
RID_SVXBMP_DOC_MODIFIED_YES
));
maImages
[
MODIFICATION_STATE_FEEDBACK
]
=
Image
(
SVX_RES
(
RID_SVXBMP_DOC_MODIFIED_FEEDBACK
));
maTimer
.
SetTimeout
(
_FEEDBACK_TIMEOUT
);
}
};
...
...
@@ -72,6 +90,7 @@ SvxModifyControl::SvxModifyControl( sal_uInt16 _nSlotId,
SfxStatusBarControl
(
_nSlotId
,
_nId
,
rStb
),
mpImpl
(
new
ImplData
)
{
mpImpl
->
maTimer
.
SetTimeoutHdl
(
LINK
(
this
,
SvxModifyControl
,
OnTimer
)
);
}
// -----------------------------------------------------------------------
...
...
@@ -84,13 +103,43 @@ void SvxModifyControl::StateChanged( sal_uInt16, SfxItemState eState,
DBG_ASSERT
(
pState
->
ISA
(
SfxBoolItem
),
"invalid item type"
);
SfxBoolItem
*
pItem
=
(
SfxBoolItem
*
)
pState
;
mpImpl
->
m
bModified
=
pItem
->
GetValue
();
mpImpl
->
m
aTimer
.
Stop
();
if
(
GetStatusBar
().
AreItemsVisible
()
)
GetStatusBar
().
SetItemData
(
GetId
(),
0
);
// force repaint
bool
modified
=
pItem
->
GetValue
();
bool
start
=
(
!
modified
&&
mpImpl
->
mnModState
==
ImplData
::
MODIFICATION_STATE_YES
);
// should timer be started and feedback image displayed ?
int
nResId
=
mpImpl
->
mbModified
?
RID_SVXSTR_DOC_MODIFIED_YES
:
RID_SVXSTR_DOC_MODIFIED_NO
;
mpImpl
->
mnModState
=
(
start
?
ImplData
::
MODIFICATION_STATE_FEEDBACK
:
(
modified
?
ImplData
::
MODIFICATION_STATE_YES
:
ImplData
::
MODIFICATION_STATE_NO
));
_repaint
();
int
nResId
=
modified
?
RID_SVXSTR_DOC_MODIFIED_YES
:
RID_SVXSTR_DOC_MODIFIED_NO
;
GetStatusBar
().
SetQuickHelpText
(
GetId
(),
SVX_RESSTR
(
nResId
));
if
(
start
)
mpImpl
->
maTimer
.
Start
();
}
// -----------------------------------------------------------------------
IMPL_LINK
(
SvxModifyControl
,
OnTimer
,
Timer
*
,
pTimer
)
{
if
(
pTimer
==
0
)
return
0
;
pTimer
->
Stop
();
mpImpl
->
mnModState
=
ImplData
::
MODIFICATION_STATE_NO
;
_repaint
();
return
0
;
}
// -----------------------------------------------------------------------
void
SvxModifyControl
::
_repaint
()
{
if
(
GetStatusBar
().
AreItemsVisible
()
)
GetStatusBar
().
SetItemData
(
GetId
(),
0
);
// force repaint
}
// -----------------------------------------------------------------------
...
...
@@ -119,26 +168,21 @@ Point centerImage(const Rectangle& rBoundingRect, const Image& rImg)
}
}
void
SvxModifyControl
::
Paint
(
const
UserDrawEvent
&
rUsrEvt
)
{
OutputDevice
*
pDev
=
rUsrEvt
.
GetDevice
();
Rectangle
aRect
=
rUsrEvt
.
GetRect
();
if
(
mpImpl
->
mbModified
)
{
Point
aPt
=
centerImage
(
aRect
,
mpImpl
->
maModifiedButton
);
pDev
->
DrawImage
(
aPt
,
mpImpl
->
maModifiedButton
);
}
else
{
Point
aPt
=
centerImage
(
aRect
,
mpImpl
->
maNonModifiedButton
);
pDev
->
DrawImage
(
aPt
,
mpImpl
->
maNonModifiedButton
);
}
ImplData
::
ModificationState
state
=
mpImpl
->
mnModState
;
Point
aPt
=
centerImage
(
aRect
,
mpImpl
->
maImages
[
state
]);
pDev
->
DrawImage
(
aPt
,
mpImpl
->
maImages
[
state
]);
}
void
SvxModifyControl
::
DoubleClick
()
{
if
(
!
mpImpl
->
mbModified
)
if
(
mpImpl
->
mnModState
!=
ImplData
::
MODIFICATION_STATE_YES
)
// document not modified. nothing to do here.
return
;
...
...
svx/source/stbctrls/stbctrls.src
Dosyayı görüntüle @
bcbabc4b
...
...
@@ -301,3 +301,11 @@ Image RID_SVXBMP_DOC_MODIFIED_NO
};
MaskColor = STD_MASKCOLOR;
};
Image RID_SVXBMP_DOC_MODIFIED_FEEDBACK
{
ImageBitmap = Bitmap
{
File = "doc_modified_feedback.png" ;
};
MaskColor = STD_MASKCOLOR;
};
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