pisd
git-svn-id: svn://db.shs.com.ru/pip@43 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
@@ -161,6 +161,7 @@ void PIScreenTile::sizeHint(int & w, int & h) const {
|
|||||||
if (direction == Horizontal) w += sl;
|
if (direction == Horizontal) w += sl;
|
||||||
else h += sl;
|
else h += sl;
|
||||||
piForeachC (PIScreenTile * t, tiles) {
|
piForeachC (PIScreenTile * t, tiles) {
|
||||||
|
if (!t->visible) continue;
|
||||||
int cw(0), ch(0);
|
int cw(0), ch(0);
|
||||||
t->sizeHint(cw, ch);
|
t->sizeHint(cw, ch);
|
||||||
cw = piClampi(cw, t->minimumWidth, t->maximumWidth);
|
cw = piClampi(cw, t->minimumWidth, t->maximumWidth);
|
||||||
|
|||||||
@@ -95,8 +95,10 @@ void TileList::sizeHint(int & w, int & h) const {
|
|||||||
|
|
||||||
void TileList::drawEvent(PIScreenDrawer * d) {
|
void TileList::drawEvent(PIScreenDrawer * d) {
|
||||||
lhei = height - 2;
|
lhei = height - 2;
|
||||||
|
int osp = piMini(3, lhei / 4);
|
||||||
int is = piClampi(offset, 0, piMaxi(0, content.size_s() - 1)), ie = piClampi(offset + lhei, 0, content.size_s());
|
int is = piClampi(offset, 0, piMaxi(0, content.size_s() - 1)), ie = piClampi(offset + lhei, 0, content.size_s());
|
||||||
if (is > 0) d->drawText(x, y, PIString(" /\\ ").repeat(width / 4), Green, Default, Bold);
|
if (is > 0) d->drawText(x, y, PIString(" /\\ ").repeat(width / 4), Green, Default, Bold);
|
||||||
|
//piCout << is << ie << offset << lhei << content.size_s();
|
||||||
for (int i = is; i < ie; ++i) {
|
for (int i = is; i < ie; ++i) {
|
||||||
Row & r(content[i]);
|
Row & r(content[i]);
|
||||||
bool sel = i == cur && has_focus;
|
bool sel = i == cur && has_focus;
|
||||||
@@ -178,6 +180,7 @@ bool TileList::keyEvent(PIKbdListener::KeyEvent key) {
|
|||||||
if (cur >= content.size_s()) cur = content.size_s() - 1;
|
if (cur >= content.size_s()) cur = content.size_s() - 1;
|
||||||
if (cur - offset >= lhei - osp) offset += oo;
|
if (cur - offset >= lhei - osp) offset += oo;
|
||||||
if (offset >= content.size_s() - lhei) offset = content.size_s() - lhei;
|
if (offset >= content.size_s() - lhei) offset = content.size_s() - lhei;
|
||||||
|
if (offset < 0) offset = 0;
|
||||||
return true;
|
return true;
|
||||||
case PIKbdListener::Home:
|
case PIKbdListener::Home:
|
||||||
cur = offset = 0;
|
cur = offset = 0;
|
||||||
@@ -185,6 +188,7 @@ bool TileList::keyEvent(PIKbdListener::KeyEvent key) {
|
|||||||
case PIKbdListener::End:
|
case PIKbdListener::End:
|
||||||
cur = content.size_s() - 1;
|
cur = content.size_s() - 1;
|
||||||
offset = content.size_s() - lhei;
|
offset = content.size_s() - lhei;
|
||||||
|
if (offset < 0) offset = 0;
|
||||||
return true;
|
return true;
|
||||||
case PIKbdListener::Return:
|
case PIKbdListener::Return:
|
||||||
if (cur >= 0 && cur < content.size_s())
|
if (cur >= 0 && cur < content.size_s())
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
extern PIScreen screen;
|
extern PIScreen screen;
|
||||||
|
|
||||||
Daemon::Daemon(): PIPeer("_pisd_" + PISystemInfo::instance()->hostname + "_" + PIString(rand() % 100)) {
|
Daemon::Daemon(): PIPeer("_pisd_" + PISystemInfo::instance()->hostname + "_" + PIString(rand() % 100)), fm(this) {
|
||||||
setName("Daemon");
|
setName("Daemon");
|
||||||
timer.setName("__S__Daemon_timer");
|
timer.setName("__S__Daemon_timer");
|
||||||
mode = offset = cur = height = 0;
|
mode = offset = cur = height = 0;
|
||||||
@@ -58,6 +58,7 @@ void Daemon::hideAll() {
|
|||||||
list_actions->hide();
|
list_actions->hide();
|
||||||
tile_info->hide();
|
tile_info->hide();
|
||||||
list_daemons->hide();
|
list_daemons->hide();
|
||||||
|
tile_fm->hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -82,8 +82,8 @@ private:
|
|||||||
PISystemMonitor sys_mon_other;
|
PISystemMonitor sys_mon_other;
|
||||||
HostInfo info_my, info_other;
|
HostInfo info_my, info_other;
|
||||||
FileManager fm;
|
FileManager fm;
|
||||||
PIScreenTile * tile_root;
|
PIScreenTile * tile_root, * tile_fm;
|
||||||
TileSimple * tile_info, * tile_fm, * tile_header;
|
TileSimple * tile_info, * tile_header;
|
||||||
TileList * list_daemons, * list_actions;
|
TileList * list_daemons, * list_actions;
|
||||||
int mode, offset, cur, height;
|
int mode, offset, cur, height;
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ class Daemon;
|
|||||||
class FileManager: public PIObject {
|
class FileManager: public PIObject {
|
||||||
PIOBJECT(FileManager)
|
PIOBJECT(FileManager)
|
||||||
public:
|
public:
|
||||||
FileManager(Daemon * d);
|
FileManager(Daemon * d = 0);
|
||||||
|
|
||||||
PIScreenTile * tile() const;
|
PIScreenTile * tile() const;
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ _Init _pisd_init;
|
|||||||
PIScreen screen(false);
|
PIScreen screen(false);
|
||||||
PISystemMonitor sys_mon;
|
PISystemMonitor sys_mon;
|
||||||
Daemon daemon_;
|
Daemon daemon_;
|
||||||
FileManager file_manager(&daemon_);
|
FileManager file_manager;
|
||||||
|
|
||||||
|
|
||||||
class MainMenu: public PITimer {
|
class MainMenu: public PITimer {
|
||||||
|
|||||||
Reference in New Issue
Block a user