mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-18 21:30:38 +01:00
[escher] create TransparentView
This commit is contained in:
@@ -75,6 +75,7 @@ objs += $(addprefix escher/src/,\
|
||||
timer.o\
|
||||
toolbox.o\
|
||||
toolbox_message_tree.o\
|
||||
transparent_view.o\
|
||||
view.o\
|
||||
view_controller.o\
|
||||
warning_controller.o\
|
||||
|
||||
@@ -77,6 +77,7 @@
|
||||
#include <escher/timer.h>
|
||||
#include <escher/toolbox.h>
|
||||
#include <escher/toolbox_message_tree.h>
|
||||
#include <escher/transparent_view.h>
|
||||
#include <escher/view.h>
|
||||
#include <escher/view_controller.h>
|
||||
#include <escher/warning_controller.h>
|
||||
|
||||
11
escher/include/escher/transparent_view.h
Normal file
11
escher/include/escher/transparent_view.h
Normal file
@@ -0,0 +1,11 @@
|
||||
#ifndef ESCHER_TRANSPARENT_VIEW_H
|
||||
#define ESCHER_TRANSPARENT_VIEW_H
|
||||
|
||||
#include <escher/view.h>
|
||||
|
||||
class TransparentView : public View {
|
||||
public:
|
||||
void markRectAsDirty(KDRect rect) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -23,6 +23,7 @@ class Window;
|
||||
class View {
|
||||
// We only want Window to be able to invoke View::redraw
|
||||
friend class Window;
|
||||
friend class TransparentView;
|
||||
public:
|
||||
View();
|
||||
virtual ~View();
|
||||
@@ -58,7 +59,7 @@ protected:
|
||||
* - Moving a cursor -> In that case, there's really a much more efficient way
|
||||
* - ... and that's all I can think of.
|
||||
*/
|
||||
void markRectAsDirty(KDRect rect);
|
||||
virtual void markRectAsDirty(KDRect rect);
|
||||
#if ESCHER_VIEW_LOGGING
|
||||
virtual const char * className() const;
|
||||
virtual void logAttributes(std::ostream &os) const;
|
||||
|
||||
8
escher/src/transparent_view.cpp
Normal file
8
escher/src/transparent_view.cpp
Normal file
@@ -0,0 +1,8 @@
|
||||
#include <escher/transparent_view.h>
|
||||
|
||||
void TransparentView::markRectAsDirty(KDRect rect) {
|
||||
if (m_superview) {
|
||||
m_superview->markRectAsDirty(KDRect(m_superview->pointFromPointInView(this, rect.origin()), rect.size()));
|
||||
}
|
||||
View::markRectAsDirty(rect);
|
||||
}
|
||||
Reference in New Issue
Block a user