summaryrefslogtreecommitdiff
path: root/riscos/theme.c
diff options
context:
space:
mode:
authorRichard Wilson <rjw@netsurf-browser.org>2005-02-07 23:00:09 +0000
committerRichard Wilson <rjw@netsurf-browser.org>2005-02-07 23:00:09 +0000
commit350247a0f250bddef17c3bf7087af7034769bae2 (patch)
tree41c60e634cf7aba7032e4f6453df99f5144c25c1 /riscos/theme.c
parentd21ec26259be407457b8c6afe1ed921ec5029f5d (diff)
downloadnetsurf-350247a0f250bddef17c3bf7087af7034769bae2.tar.gz
netsurf-350247a0f250bddef17c3bf7087af7034769bae2.tar.bz2
[project @ 2005-02-07 23:00:09 by rjw]
Stop toolbar scrolling by 1px, make theme saving use leafnames, improve error handling svn path=/import/netsurf/; revision=1499
Diffstat (limited to 'riscos/theme.c')
-rw-r--r--riscos/theme.c29
1 files changed, 11 insertions, 18 deletions
diff --git a/riscos/theme.c b/riscos/theme.c
index a78c96790..a6615d3c3 100644
--- a/riscos/theme.c
+++ b/riscos/theme.c
@@ -87,8 +87,6 @@ static char theme_separator_name[] = "separator\0";
* Initialise the theme handler
*/
void ro_gui_theme_initialise(void) {
- /* Get an initial theme list
- */
theme_descriptors = ro_gui_theme_get_available();
}
@@ -97,8 +95,6 @@ void ro_gui_theme_initialise(void) {
* Finalise the theme handler
*/
void ro_gui_theme_finalise(void) {
- /* Free all closed descriptors
- */
ro_gui_theme_close(theme_current, false);
ro_gui_theme_free(theme_descriptors, true);
}
@@ -111,23 +107,19 @@ void ro_gui_theme_finalise(void) {
* to ro_gui_theme_get_available() unless it has been opened using
* ro_gui_theme_open().
*
- * \param filename the filename of the theme_descriptor to return
+ * \param leafname the filename of the theme_descriptor to return
* \return the requested theme_descriptor, or NULL if not found
*/
-struct theme_descriptor *ro_gui_theme_find(const char *filename) {
+struct theme_descriptor *ro_gui_theme_find(const char *leafname) {
struct theme_descriptor *descriptor;
- /* Check for bad filename
- */
- if (!filename) return NULL;
+ if (!leafname)
+ return NULL;
- /* Work through until we find our required filename
- */
- descriptor = theme_descriptors;
- while (descriptor) {
- if (!strcmp(filename, descriptor->filename)) return descriptor;
- descriptor = descriptor->next;
- }
+ for (descriptor = theme_descriptors; descriptor; descriptor = descriptor->next)
+ if ((!strcmp(leafname, descriptor->leafname)) ||
+ (!strcmp(leafname, descriptor->filename))) /* legacy (preserve options) */
+ return descriptor;
return NULL;
}
@@ -231,7 +223,7 @@ static void ro_gui_theme_get_available_in_dir(const char *directory) {
/* Only process files
*/
- if ((info.obj_type == fileswitch_IS_FILE) && (!ro_gui_theme_find(pathname))) {
+ if ((info.obj_type == fileswitch_IS_FILE) && (!ro_gui_theme_find(info.name))) {
/* Get the header
*/
@@ -280,6 +272,7 @@ static void ro_gui_theme_get_available_in_dir(const char *directory) {
return;
}
strcpy(current->filename, pathname);
+ current->leafname = current->filename + strlen(directory) + 1;
/* Link in our new descriptor
*/
@@ -1326,7 +1319,7 @@ bool ro_gui_theme_process_toolbar(struct toolbar *toolbar, int width) {
if (toolbar->reformat_buttons) {
extent.x1 = 16384;
extent.y0 = 0;
- extent.y1 = toolbar->height;
+ extent.y1 = toolbar->height - 2;
xwimp_set_extent(toolbar->toolbar_handle, &extent);
if ((parent) && (old_height != toolbar->height)) {
ro_gui_theme_attach_toolbar(toolbar, parent);