mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 09:51:57 -05:00
Throw away the Clock app since we now have a clock in the menubar. :^)
This commit is contained in:
parent
aaa11e3c25
commit
afa6f88039
8 changed files with 0 additions and 144 deletions
3
Applications/Clock/.gitignore
vendored
3
Applications/Clock/.gitignore
vendored
|
@ -1,3 +0,0 @@
|
|||
*.o
|
||||
*.d
|
||||
Clock
|
|
@ -1,37 +0,0 @@
|
|||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
#include <SharedGraphics/Painter.h>
|
||||
#include "ClockWidget.h"
|
||||
|
||||
ClockWidget::ClockWidget(GWidget* parent)
|
||||
: GWidget(parent)
|
||||
{
|
||||
set_relative_rect({ 0, 0, 100, 40 });
|
||||
start_timer(300);
|
||||
}
|
||||
|
||||
ClockWidget::~ClockWidget()
|
||||
{
|
||||
}
|
||||
|
||||
void ClockWidget::paint_event(GPaintEvent&)
|
||||
{
|
||||
auto now = time(nullptr);
|
||||
auto& tm = *localtime(&now);
|
||||
|
||||
char timeBuf[128];
|
||||
sprintf(timeBuf, "%02u:%02u:%02u", tm.tm_hour, tm.tm_min, tm.tm_sec);
|
||||
|
||||
Painter painter(*this);
|
||||
painter.fill_rect(rect(), Color::LightGray);
|
||||
painter.draw_text(rect(), timeBuf, TextAlignment::Center, Color::Black);
|
||||
}
|
||||
|
||||
void ClockWidget::timer_event(GTimerEvent&)
|
||||
{
|
||||
auto now = time(nullptr);
|
||||
if (now == m_last_time)
|
||||
return;
|
||||
m_last_time = now;
|
||||
update();
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include <LibGUI/GWidget.h>
|
||||
|
||||
class ClockWidget final : public GWidget {
|
||||
public:
|
||||
explicit ClockWidget(GWidget* parent = nullptr);
|
||||
virtual ~ClockWidget() override;
|
||||
|
||||
private:
|
||||
virtual void paint_event(GPaintEvent&) override;
|
||||
virtual void timer_event(GTimerEvent&) override;
|
||||
|
||||
time_t m_last_time { 0 };
|
||||
};
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
OBJS = \
|
||||
ClockWidget.o \
|
||||
main.o
|
||||
|
||||
APP = Clock
|
||||
|
||||
ARCH_FLAGS =
|
||||
STANDARD_FLAGS = -std=c++17 -nostdinc++ -nostdlib -nostdinc
|
||||
USERLAND_FLAGS = -ffreestanding -fno-stack-protector
|
||||
WARNING_FLAGS = -Wextra -Wall -Wundef -Wcast-qual -Wwrite-strings -Wimplicit-fallthrough
|
||||
FLAVOR_FLAGS = -march=i686 -m32 -fno-exceptions -fno-rtti
|
||||
OPTIMIZATION_FLAGS = -Os
|
||||
INCLUDE_FLAGS = -I../.. -I. -I../../LibC
|
||||
|
||||
DEFINES = -DSERENITY -DSANITIZE_PTRS -DUSERLAND
|
||||
|
||||
CXXFLAGS = -MMD -MP $(WARNING_FLAGS) $(OPTIMIZATION_FLAGS) $(USERLAND_FLAGS) $(FLAVOR_FLAGS) $(ARCH_FLAGS) $(STANDARD_FLAGS) $(INCLUDE_FLAGS) $(DEFINES)
|
||||
CXX = clang
|
||||
LD = ld
|
||||
AR = ar
|
||||
LDFLAGS = -static --strip-debug -melf_i386 -e _start --gc-sections
|
||||
|
||||
all: $(APP)
|
||||
|
||||
$(APP): $(OBJS)
|
||||
$(LD) -o $(APP) $(LDFLAGS) $(OBJS) ../../LibGUI/LibGUI.a ../../LibC/LibC.a
|
||||
|
||||
.cpp.o:
|
||||
@echo "CXX $<"; $(CXX) $(CXXFLAGS) -o $@ -c $<
|
||||
|
||||
-include $(OBJS:%.o=%.d)
|
||||
|
||||
clean:
|
||||
@echo "CLEAN"; rm -f $(APPS) $(OBJS) *.d
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
#include <LibGUI/GApplication.h>
|
||||
#include <LibGUI/GWindow.h>
|
||||
#include "ClockWidget.h"
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
GApplication app(argc, argv);
|
||||
|
||||
auto* window = new GWindow;
|
||||
window->set_title("Clock");
|
||||
window->set_rect({ 600, 100, 100, 40 });
|
||||
window->set_should_exit_app_on_close(true);
|
||||
|
||||
auto* clock_widget = new ClockWidget;
|
||||
clock_widget->set_relative_rect({ 0, 0, 100, 40 });
|
||||
window->set_main_widget(clock_widget);
|
||||
|
||||
window->show();
|
||||
return app.exec();
|
||||
}
|
||||
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
sudo id
|
||||
|
||||
make -C ../LibC clean && \
|
||||
make -C ../LibC && \
|
||||
make -C ../LibGUI clean && \
|
||||
make -C ../LibGUI && \
|
||||
make -C ../Applications/Terminal clean && \
|
||||
make -C ../Applications/Terminal && \
|
||||
make -C ../Applications/Clock clean && \
|
||||
make -C ../Applications/Clock && \
|
||||
make -C ../Applications/Launcher clean && \
|
||||
make -C ../Applications/Launcher && \
|
||||
make -C ../Applications/FileManager clean && \
|
||||
make -C ../Applications/FileManager && \
|
||||
make -C ../Applications/FontEditor clean && \
|
||||
make -C ../Applications/FontEditor && \
|
||||
make -C ../Userland clean && \
|
||||
make -C ../Userland && \
|
||||
sudo ./sync.sh
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
sudo id
|
||||
|
||||
make -C ../FontEditor clean && \
|
||||
make -C ../FontEditor && \
|
||||
sudo ./sync.sh
|
||||
|
|
@ -74,7 +74,6 @@ chmod 4755 mnt/bin/su
|
|||
cp -v ../Applications/Terminal/Terminal mnt/bin/Terminal
|
||||
cp -v ../Applications/FontEditor/FontEditor mnt/bin/FontEditor
|
||||
cp -v ../Applications/Launcher/Launcher mnt/bin/Launcher
|
||||
cp -v ../Applications/Clock/Clock mnt/bin/Clock
|
||||
cp -v ../Applications/FileManager/FileManager mnt/bin/FileManager
|
||||
cp -v ../Applications/About/About mnt/bin/About
|
||||
cp -v ../WindowServer/WindowServer mnt/bin/WindowServer
|
||||
|
|
Loading…
Add table
Reference in a new issue