Skip to content

Commit bc66500

Browse files
authored
AboutWindow + format (#25)
* AboutWindow + format -Change buttons in AboutWindow with links to haiku pages -Clean #includes * AboutWindow + format -Change buttons in AboutWindow with links to haiku pages -Clean #includes
1 parent 2b29d0e commit bc66500

File tree

13 files changed

+29
-55
lines changed

13 files changed

+29
-55
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ LOCAL_INCLUDE_PATHS = Src/Source \
114114

115115
# Specify the level of optimization that you want. Specify either NONE (O0),
116116
# SOME (O1), FULL (O2), or leave blank (for the default optimization level).
117-
OPTIMIZE := NONE
117+
OPTIMIZE := FULL
118118

119119
# Specify the codes for languages you are going to support in this
120120
# application. The default "en" one must be provided too. "make catkeys"

Src/Headers/AboutWindow.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#define ABOUT_WINDOW_H
99

1010
#include <be/app/Message.h>
11+
#include <be/app/MessageRunner.h>
1112
#include <be/app/Messenger.h>
1213
#include <be/interface/Bitmap.h>
1314
#include <be/interface/Button.h>
@@ -17,7 +18,7 @@
1718
#include "GradientView.h"
1819

1920
const uint32 UPDATE_COLORS = 'updt';
20-
const int32 UPDATE_TIME = 100;
21+
const int32 UPDATE_TIME = 2000;
2122

2223
class AboutView : public BView {
2324
public:
@@ -44,7 +45,7 @@ class AboutWindow : public BWindow {
4445
private:
4546
AboutView* m_about;
4647
BMessenger* m_msgr;
47-
48+
BMessageRunner* m_run;
4849
BButton *m_homePage, *m_donate, *m_beBits, *m_quit;
4950

5051
GradientView* m_gradient;

Src/Headers/Constants.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,7 @@ namespace AboutMessages
206206
const uint32 K_ABOUT_WINDOW_QUIT = 'abwq',
207207
K_ABOUT_WINDOW_LAUNCH = 'abwg',
208208
K_GOTO_BETEX_HOMEPAGE = 'gtbh',
209-
K_GOTO_BETEX_DONATEPAGE = 'gtbd',
210-
K_GOTO_BETEX_BEBITSPAGE = 'gbbb'
209+
K_GOTO_BETEX_DONATEPAGE = 'gtbd'
211210
;
212211
};
213212

Src/Headers/MainWindow.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
#include <be/interface/MenuItem.h>
77
#include <be/interface/Rect.h>
88
#include <be/interface/ScrollView.h>
9-
#include <be/interface/View.h>
10-
#include <be/interface/Window.h>
119
#include <be/storage/FilePanel.h>
1210
#include <be/storage/FindDirectory.h>
1311
#include <be/storage/NodeMonitor.h>
@@ -17,9 +15,9 @@
1715
using std::vector;
1816

1917
#include "AboutWindow.h"
20-
#include "BubbleHelper.h"
2118
#include "ColorWindow.h"
2219
#include "DimensionWindow.h"
20+
#include "DocView.h"
2321
#include "GoToLineWindow.h"
2422
#include "MainTBar.h"
2523
#include "PrefsWindow.h"
@@ -29,8 +27,6 @@ using std::vector;
2927
#include "SplitPane.h"
3028
#include "StatusBar.h"
3129
#include "TexBar.h"
32-
#include "TexView.h"
33-
#include "iconheaders/ConverterIcons.h"
3430

3531
class MainWindow : public BWindow {
3632
public:

Src/Headers/Prefs.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
#include <iostream>
55
#include <map>
6-
#include <string>
76

87
#include <Archivable.h>
98
#include <File.h>

Src/Headers/PrefsWindow.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@
77
#include <be/interface/CheckBox.h>
88
#include <be/interface/Rect.h>
99
#include <be/interface/Slider.h>
10-
#include <be/interface/StringView.h>
11-
#include <be/interface/TextControl.h>
12-
#include <be/interface/View.h>
13-
#include <be/interface/Window.h>
1410

1511
#include "ColorButton.h"
1612
#include "Prefs.h"

Src/Headers/ProjectItem.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#include <be/interface/ListItem.h>
1111
#include <be/interface/Rect.h>
1212
#include <be/interface/ScrollView.h>
13-
#include <be/interface/View.h>
1413
#include <be/storage/Path.h>
1514

1615

Src/Headers/SearchWindow.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
#include <be/interface/CheckBox.h>
77
#include <be/interface/Rect.h>
88
#include <be/interface/ScrollView.h>
9-
#include <be/interface/View.h>
10-
#include <be/interface/Window.h>
119
#include "TexView.h"
1210

1311
class ParentView;

Src/Headers/TexView.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
#include <be/interface/Rect.h>
88
#include <be/interface/TextView.h>
99
#include <be/storage/Entry.h>
10-
#include <be/storage/File.h>
1110
#include <be/support/String.h>
1211

1312
#include <Messenger.h>

Src/Source/AboutWindow.cpp

Lines changed: 22 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ AboutView::Draw(BRect updateRect)
3838
DrawBitmap(m_logo);
3939
MovePenTo((updateRect.Width() - m_logo->Bounds().Width()) / 4, 0);
4040

41-
MovePenBy(0, 100);
41+
MovePenBy(0, 90);
4242
BPoint p = PenLocation();
4343

4444
BString about_line;
45-
// about_line << "BeTeX " << BETEX_VERSION << " by Brent Miszalski";
45+
about_line << "BeTeX " /*<< BETEX_VERSION <<*/ " by Brent Miszalski";
4646
DrawString(about_line.String()); //.\nThanks to:\n\tEli Dayan\n\tMichael Pfeiffer\n");
4747
MovePenTo(p);
4848
MovePenBy(0, 20);
@@ -51,6 +51,9 @@ AboutView::Draw(BRect updateRect)
5151
MovePenTo(p);
5252
MovePenBy(font.StringWidth("Thanks To: "), 20);
5353
DrawString("Michael Pfeiffer");
54+
MovePenTo(p);
55+
MovePenBy(0, 40);
56+
DrawString("Adapted to Haiku by Sylvain Kerjean");
5457

5558
updateRect = Bounds();
5659
SetHighColor(tint_color(ui_color(B_PANEL_BACKGROUND_COLOR), B_LIGHTEN_2_TINT));
@@ -94,51 +97,46 @@ AboutWindow::AboutWindow(BRect frame, BMessenger* messenger)
9497
AddChild(m_gradient = new GradientView(specRect, m_top, m_bottom));
9598

9699
BRect aboutRect = Bounds();
97-
aboutRect.InsetBy(80, 60);
100+
aboutRect.InsetBy(70, 60);
98101
m_about = new AboutView(aboutRect);
99102
m_about->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
100103
m_gradient->AddChild(m_about);
101104

102105
int bwidth = 50;
103106
int bheight = 30;
104-
int bpad = 10;
105-
BRect btnRect(frame.right - (2 * bpad) - bwidth, frame.bottom - (2 * bpad) - bheight,
106-
frame.right - (2 * bpad), frame.bottom - (2 * bpad));
107+
int bpad = (aboutRect.Width() - (60 + 120 + 50)) / 2;
108+
BRect btnRect(
109+
aboutRect.right - bwidth, frame.bottom - 15 - bheight, aboutRect.right, frame.bottom - 15);
107110
m_quit
108111
= new BButton(btnRect, "quitbtn", "OK", new BMessage(AboutMessages::K_ABOUT_WINDOW_QUIT));
109112
m_quit->MakeDefault(true);
110-
m_gradient->AddChild(m_quit);
111-
112-
bwidth = 100;
113-
btnRect = BRect(frame.right - (2 * bpad) - bwidth, frame.bottom - (2 * bpad) - bheight,
114-
frame.right - (2 * bpad), frame.bottom - (2 * bpad));
115-
btnRect.OffsetBy(-(50 + (2 * bpad)), 0);
116113

114+
bwidth = 120;
115+
btnRect = BRect(
116+
aboutRect.right - bwidth, frame.bottom - 15 - bheight, aboutRect.right, frame.bottom - 15);
117+
btnRect.OffsetBy(-(50 + bpad), 0);
117118
m_homePage = new BButton(btnRect, "homepagebtn", "BeTeX Homepage",
118119
new BMessage(AboutMessages::K_GOTO_BETEX_HOMEPAGE));
119-
m_gradient->AddChild(m_homePage);
120120

121-
btnRect.OffsetBy(-(80 + (2 * bpad)), 0);
122-
btnRect.right = btnRect.left + 80;
123-
m_beBits = new BButton(
124-
btnRect, "fBeBitsbtn", "BeBits Page", new BMessage(AboutMessages::K_GOTO_BETEX_BEBITSPAGE));
125-
m_gradient->AddChild(m_beBits);
126-
127-
btnRect.OffsetBy(-(60 + (2 * bpad)), 0);
128-
btnRect.right = btnRect.left + 60;
121+
btnRect.OffsetBy(-(120 + bpad), 0);
122+
btnRect.left = btnRect.right - 60;
129123
m_donate = new BButton(
130124
btnRect, "fDonatebtn", "Donate", new BMessage(AboutMessages::K_GOTO_BETEX_DONATEPAGE));
125+
131126
m_gradient->AddChild(m_donate);
127+
m_gradient->AddChild(m_homePage);
128+
m_gradient->AddChild(m_quit);
132129

133130
BMessenger mymsnger(this);
134131
BMessage increment(UPDATE_COLORS);
135-
132+
m_run = new BMessageRunner(mymsnger, &increment, UPDATE_TIME, -1);
136133
m_msgr = messenger;
137134
}
138135

139136
AboutWindow::~AboutWindow()
140137
{
141138
delete m_msgr;
139+
delete m_run;
142140
}
143141

144142
void
@@ -195,19 +193,13 @@ AboutWindow::MessageReceived(BMessage* msg)
195193
} break;
196194
case AboutMessages::K_GOTO_BETEX_HOMEPAGE:
197195
{
198-
const char* url = "http://misza.beosjournal.org";
199-
be_roster->Launch("text/html", 1, (char**)&url);
200-
Quit();
201-
} break;
202-
case AboutMessages::K_GOTO_BETEX_BEBITSPAGE:
203-
{
204-
const char* url = "http://www.bebits.com/app/3919";
196+
const char* url = "https://github.com/HaikuArchives/BeTeX";
205197
be_roster->Launch("text/html", 1, (char**)&url);
206198
Quit();
207199
} break;
208200
case AboutMessages::K_GOTO_BETEX_DONATEPAGE:
209201
{
210-
const char* url = "http://misza.beosjournal.org/donate.html";
202+
const char* url = "https://www.haiku-inc.org/donate";
211203
be_roster->Launch("text/html", 1, (char**)&url);
212204
Quit();
213205
} break;

0 commit comments

Comments
 (0)